Page 1 of 1

mysql_query --> since v1.3.9

Posted: Wed 9. Jul 2008, 22:48
by Jensensen
since johan_further opened another --> Question and Answer session / Q&A session / 'question session'

I'd like to ask

[x]

Thank you :)

Re: mysql_query --> since v1.3.9

Posted: Wed 9. Jul 2008, 23:00
by juergen
Hi Jens,

when working inside phpwcms best thing (if your programm might work on different Serevrs)is (in my eyes) to use Olivers wrappers... and (again( in my eyes)) any work with dbcon on phpwcms Level might become an error gun ..

Re: mysql_query --> since v1.3.9

Posted: Wed 9. Jul 2008, 23:34
by Jensensen
Hi [Jürgen],
thanks for the quick reply.
Well,

[x]

Re: mysql_query --> since v1.3.9

Posted: Wed 9. Jul 2008, 23:54
by Jensensen
When you add

[x]

Re: mysql_query --> since v1.3.9

Posted: Thu 17. Jul 2008, 22:37
by Jensensen
does anybody have any new info?

Re: mysql_query --> since v1.3.9

Posted: Sun 20. Jul 2008, 01:06
by Jensensen
thank you.
i'll try/do myself.......

Re: mysql_query --> since v1.3.9

Posted: Sun 20. Jul 2008, 11:21
by Oliver Georgi
If you are "inside" of phpwcms never re-connect to the database. Each time you open a script inside of phpwcms db connection is opened.

Just use the wrapper functions inside of phpwcms as defined in include/inc_lib/dbcon.inc.php. That functions work global so you do not have to be care about anything related to db connection, collations and so on.

The main function which can handle nearly every speciality is:
_dbQuery(string Query, string Mode)
Possible modes are: INSERT, DELETE, UPDATE, ON_DUPLICATE, ROW, ARRAY, COUNT, SET, CREATE.

There are additional db related functions which most time wrap special functions and then use _dbQuery() again:
_dbCount(string Query)
_dbInsert(string Table, array Data[, string Special (LOW_PRIORITY, DELAYED)[, string Table Prefix]])
_dbInsertOrUpdate(string Table, array Data[, string Where[, string Table Prefix]])
_dbGet(string Table[, string Select[, string Where[, string Groupy By[, string Order By[, string Limit[, string Table Prefix]]]]]])
_dbUpdate(string Table, array Data[, string Where[, string Special (LOW_PRIORITY, DELAYED)[, string Table Prefix]]])
_dbDuplicateRow(string Table, string Unique Fieldname, string or integer Field Value/ID[, array Exceptions[, string Table Prefix]])
_dbGetCreateCharsetCollation()

Please, some of these are not trivial to understand - coders should have a look inside code especially for _dbDuplicateRow().


If you need to know what a function might return as result always try:

Code: Select all

$result = _dbQuery(...);
// echo
dumpVar($result);
// get debugging information
$myDebugVar = dumpVar($result, 2);
echo $myDebugVar;

Oliver