Page 1 of 1

PHP MYSQL query returns false, how to debug

Posted: Thu Nov 13, 2008 11:58 am
by anton__
If a query simply returns false and the mysql log doesn't have any information, how would you go about debugging this? Thanks.

Re: PHP MYSQL query returns false, how to debug

Posted: Thu Nov 13, 2008 12:16 pm
by Eran

Code: Select all

 
$result = mysql_query(...);
if($result === false) {
      echo mysql_error($result);
}
 

Re: PHP MYSQL query returns false, how to debug

Posted: Thu Nov 13, 2008 12:19 pm
by anton__
Hi

Thanks for the quick reply - will try that straight away - your blog sounds promising too!