View Full Version : What changed since last night?

[email protected]
01-21-2009, 11:19 PM
Why won't this work today? I was able to query my database last night, but today no joy. (OK, I did have some problems -- I was able to create records but MySQL wasn't returning any value -- but today I realized I had insufficient permissions, which I have repaired.)

This should work, right?

$output = "<ids>\n";

if ($result = $mysqli->query($query)) {
while( $row = $result->fetch_assoc() ) {
$output .= "\t<eventid>" . $row['eventid'] . "</eventid>\n";
$output .= "\t<eventeditid>" . $row['eventeditid'] . "</eventeditid>\n";

$output .= "</ids>";


My forehead is so bloody and pulpy that maybe I'm missing something.

Any help would be appreciated,


PS I know my query is correct. I can paste it into phpMyAdmin and it works. I just can't query the database from PHP. I also know that PHP is processing the query properly (ie: converting variables in the query) because PHP is returning the query to Flash and that's what I'm pasting into phpMyAdmin.

[email protected]
01-22-2009, 03:24 AM
I am such an idiot. Somehow this:

if ($mysqli->multi_query($query)) {

became this:

if ($mysqli->query($query)) {

That's what happens when you cut and paste scripts and you don't pay attention.


01-22-2009, 03:41 AM
Glad to hear that you found the problem quick... That's type of error that's somewhat hard to find... ;)

[email protected]
01-22-2009, 03:45 AM
Thanks, it was hard to find. Had to step away for a while and when I looked at the code again, it jumped out at me.

Yeah, me!

01-22-2009, 03:50 AM
Yay!!! :)