It means that the MySQL server choked on your query for one reason or another, so mysql_query() returned Boolean false instead of a query result resource.
In other words, check the result for false, and if so, do whatever sort of debugging you prefer at that point.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Hi,
I'm no expert but for the code you have supplied, it looks like you are not running your query. Before you count your rows you will need to run the query :
$r=mysql_query($queryvoid);
mysql_num_rows function takes only one argument: the query result variable (i.e. $r in this case), therefore you code should read:
Hi,
I'm no expert but for the code you have supplied, it looks like you are not running your query. Before you count your rows you will need to run the query :
$r=mysql_query($queryvoid);
mysql_num_rows function takes only one argument: the query result variable (i.e. $r in this case), therefore you code should read:
$num_rows=mysql_num_rows($r);
try that and see if it works
regards
LF
Good point, in that on a second look, I see the original code executes the query via an unknown (to me at this point) object method $this->db->query. It may be that this is not even a mysql_query() call, in which case mysql_num_rows() is of no use at this point. Instead you would need to use whatever the comparable method is for that db object you are using.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks