Ok, I have a real riddle this time. I have a query that, when run, throws the following error:
mysql_fetch_array(): supplied argument is not a valid MySQL result resource
Not unusual, I know. But... here is where the riddle comes in. There is no problem with the query itself. This is a standard query:
$a="select * from stuff";
$b=mysql_query($a) or die(mysql_error());
while($c=mysql_fetch_array($b, MYSQL_ASSOC))
The query is run on several other pages of this site and works perfectly. I even went so far as to copy and paste it from a working page into the current page... it still threw the error. There is literally nothing on this page before the query that would cause the error.
I know the issue isn't with the db connection or the query itself because if I change the mysql_fetch_array() statement to something like
$c=mysql_num_rows($b);
it returns the exact number of rows in that table. So the query itself does not return false. It returns data. I'm really scratching my head here and would love to here any ideas that are out there.
mysql_fetch_array(): supplied argument is not a valid MySQL result resource
Not unusual, I know. But... here is where the riddle comes in. There is no problem with the query itself. This is a standard query:
$a="select * from stuff";
$b=mysql_query($a) or die(mysql_error());
while($c=mysql_fetch_array($b, MYSQL_ASSOC))
The query is run on several other pages of this site and works perfectly. I even went so far as to copy and paste it from a working page into the current page... it still threw the error. There is literally nothing on this page before the query that would cause the error.
I know the issue isn't with the db connection or the query itself because if I change the mysql_fetch_array() statement to something like
$c=mysql_num_rows($b);
it returns the exact number of rows in that table. So the query itself does not return false. It returns data. I'm really scratching my head here and would love to here any ideas that are out there.