I am making a search condition where i see if the $result=mysqli_query($dbconnect,$someQuery);
if($result==false) orif($result==null) but it doesn't respond to a boolean as a compared value. although if the condition is satisfied, the if($result==true) condition is called.
this is my query
$someQuery="select * from books where bookid = '$id'";
what condition checks if the mysql query failed or returned nothing?
解决方案
mysql_query() returns false always if there is any query error.For a successful queries it wont return false..The return value will be true and if the row is not empty it will return the mysqli_result() object.
Please have a look here.It might help more ..:)