PHP MYSQL query returns false, how to debug

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
anton__
Forum Newbie
Posts: 4
Joined: Thu Nov 13, 2008 11:46 am
Location: Bristol, UK

PHP MYSQL query returns false, how to debug

Post 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.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: PHP MYSQL query returns false, how to debug

Post by Eran »

Code: Select all

 
$result = mysql_query(...);
if($result === false) {
      echo mysql_error($result);
}
 
anton__
Forum Newbie
Posts: 4
Joined: Thu Nov 13, 2008 11:46 am
Location: Bristol, UK

Re: PHP MYSQL query returns false, how to debug

Post by anton__ »

Hi

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