[Wylug-help] PHP / MySQL development question

Roger Beaumont roger.bea at blueyonder.co.uk
Fri Oct 12 12:20:47 BST 2007


Hi y'all,

I picked up Lee Evans appeal for assistance and so far, so good, but I've 
just picked up a usage in the code that I've never seen before:
------------------------------------------------
/* update log */
   $log_q_str = "INSERT INTO log (blah) VALUES ('blah')"; // edited !!
   $event = mysql_query($log_q_str);
   mysql_query($event);
------------------------------------------------
According to the docs, mysql_query() returns a resource for SEARCH and such 
queries that retrieve rows from a table, but for others (which I believe 
includes INSERT) it returns a boolean, which would mean the second 
mysql_query() is nonsense (but presumably error messages are ignored).

Am I right (which would explain why I've not seen this construct before) or 
does it do something I'm not understanding?

TIA,

Roger




More information about the Wylug-help mailing list