mysql_query --> since v1.3.9

If you've problems with unsupported - non official ;-) - functionalities use this forum please.
Post Reply
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

mysql_query --> since v1.3.9

Post by Jensensen »

since johan_further opened another --> Question and Answer session / Q&A session / 'question session'

I'd like to ask

[x]

Thank you :)
Last edited by Jensensen on Sat 20. Sep 2008, 21:46, edited 1 time in total.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Re: mysql_query --> since v1.3.9

Post 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 ..
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: mysql_query --> since v1.3.9

Post by Jensensen »

Hi [Jürgen],
thanks for the quick reply.
Well,

[x]
Last edited by Jensensen on Sat 20. Sep 2008, 21:47, edited 1 time in total.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: mysql_query --> since v1.3.9

Post by Jensensen »

When you add

[x]
Last edited by Jensensen on Sat 20. Sep 2008, 21:47, edited 1 time in total.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: mysql_query --> since v1.3.9

Post by Jensensen »

does anybody have any new info?
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: mysql_query --> since v1.3.9

Post by Jensensen »

thank you.
i'll try/do myself.......
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
Oliver Georgi
Site Admin
Posts: 9888
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: mysql_query --> since v1.3.9

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Post Reply