no result from querry but $result still not empty
Posted: Sat Jul 17, 2010 7:18 pm
Hi,
I'm working on a php form that queries mysql. When I use
Even with bad input that returns no result it acts as if there is still something in $result.
Doesn't work. Nothing is echoed.
echoes "resource id #4"
Should I stick with using my $row count for the condition in "if" and "case" statements?
I thought the above "if(!isset($result))" is the right way.
Thanks
I'm working on a php form that queries mysql. When I use
Code: Select all
$result= mysql_query($sql);Code: Select all
if(!isset($result)){
echo "nothing found";
}
Code: Select all
echo $result;
Should I stick with using my $row count for the condition in "if" and "case" statements?
I thought the above "if(!isset($result))" is the right way.
Thanks