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: 2986
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

mysql_query --> since v1.3.9

Post by Jensensen » Wed 9. Jul 2008, 22:48

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: 4549
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Re: mysql_query --> since v1.3.9

Post by juergen » Wed 9. Jul 2008, 23:00

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: 2986
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: mysql_query --> since v1.3.9

Post by Jensensen » Wed 9. Jul 2008, 23:34

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: 2986
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: mysql_query --> since v1.3.9

Post by Jensensen » Wed 9. Jul 2008, 23:54

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: 2986
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: mysql_query --> since v1.3.9

Post by Jensensen » Thu 17. Jul 2008, 22:37

does anybody have any new info?
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.

User avatar
Jensensen
Posts: 2986
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: mysql_query --> since v1.3.9

Post by Jensensen » Sun 20. Jul 2008, 01:06

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: 9450
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau
Contact:

Re: mysql_query --> since v1.3.9

Post by Oliver Georgi » Sun 20. Jul 2008, 11:21

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 | Kleintierpraxis am Georgengarten

Post Reply