I have this code:
$rows = array();
$res = mysql_query($someQuery);
if(!mysql_errno())
while($row = mysql_fetch_assoc($res))
$rows[] = $row;
some query is an arbitrary query that I write in to a form. The mysql_errno catches the case when I write a mysql query with errors in it. But, I just discovered that when I do a "Delete from table_name" query, it of course is not an error, but at the same time the mysql_fetch_assoc fails with a "Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /blah/blah/file.php on line x".
I've tried to look for it in the manual (maybe I'm just blind...) but is there a function I can use to check if $res is a valid MySQL result resource or not?