since johan_further opened another --> Question and Answer session / Q&A session / 'question session'
I'd like to ask
[x]
Thank you
mysql_query --> since v1.3.9
Re: mysql_query --> since v1.3.9
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 ..
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
Hi [Jürgen],
thanks for the quick reply.
Well,
[x]
thanks for the quick reply.
Well,
[x]
Last edited by Jensensen on Sat 20. Sep 2008, 21:47, edited 1 time in total.
Re: mysql_query --> since v1.3.9
does anybody have any new info?
Re: mysql_query --> since v1.3.9
thank you.
i'll try/do myself.......
i'll try/do myself.......
- Oliver Georgi
- Site Admin
- Posts: 9892
- Joined: Fri 3. Oct 2003, 22:22
- Contact:
Re: mysql_query --> since v1.3.9
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:
Oliver
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