Page 2 of 2
Posted: Tue Jun 06, 2006 7:38 pm
by bdlang
Daedalus- wrote:I thought hard about whether there would be multiple queries at one time. I believe that everything I need to do can be accomplished using JOINs. I had already been thinking about how to fix the function if I did need to make more than one and I figure that I could say something like:
"SELECT * FROM users WHERE name = '$s'; SELECT * FROM images WHERE id = '%d'"
FYI, before you get too wrapped up in that idea, you should be aware that
mysql_query() will only allow a single query at a time.
Posted: Wed Jun 07, 2006 12:50 pm
by daedalus__
No no, what I would do is take
Code: Select all
$sql = "SELECT * FROM blah WHERE doody = gross; UPDATE blah SET doody = brown; SELECT * FROM blah WHERE doody = brown";
$sql = explode("; ", $sql);
echo $sql[0]; // SELECT * FROM blah WHERE doody = gross
echo $sql[1]; // UPDATE blah SET doody = brown
echo $sql[2]; // SELECT * FROM blah WHERE doody = brown
You likee?
One thing I forgot to mention. The error that I was having, when I started this thread is still appearing!! Sort of.
The page still dies at the same place, but no error message is displayed.
I can post the code if anyone would like, or I can explain what is happening.