mysql_num_rows(): supplied argument is not a valid MySQL result resource
Posted
by php-b-grader
on Stack Overflow
See other posts from Stack Overflow
or by php-b-grader
Published on 2010-05-28T01:08:07Z
Indexed on
2010/05/28
1:11 UTC
Read the original article
Hit count: 158
I am getting this error when I pass an invalid SQL string... I spent the last hour trying to find the problem assuming - It's not my SQL it must be the db handle... ANyway, I've now figured out that it was bad SQL...
What I want to do is test the result of the mysql_query() for a valid resultset.
I am simply using empty($result)... Is this the most effective test? Is there a more widely accepted method of testing a resultset for a valid result?
© Stack Overflow or respective owner