All Queries TRUE even when they should be FALSE
| From: | Monty | Date: | Fri, 20 Sep 2002 22:25:57 +0000 |
| Subject: | All Queries TRUE even when they should be FALSE | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-117062@lists.php.net to get a copy of this message | ||
Even though I have no record in my MySQL DB with that has "005" in the ID
field, the following statement always reverts to Record Found, or True, no
matter what ID I use. What's wrong? I'm using PHP 4.2.2. Has something
changed that makes this work differently? Thanks.
--------
$query = "SELECT id FROM member WHERE id = 005";
$connect = mysql_pconnect("localhost", "dbname", "password");
$result = mysql_query( $query, $connect ); // Query DB.
if ( !empty($result) ) {
echo "RECORD FOUND";
} else {
echo "RECORD NOT FOUND";
}