Re: mysql if empty

From: Date: Mon, 09 Apr 2007 21:27:57 +0000
Subject: Re: mysql if empty
References: 1 2 3 4 5 6 7 8 9  Groups: php.general 
Request: Send a blank email to php-general+get-252369@lists.php.net to get a copy of this message
chris@aquanuke.com wrote:
If I search for something in mysql that returns an empty result I cant get it to return "No result found" always returns "Found" even though the recoed does not exist... $sql = "SELECT Client FROM booked WHERE Name = 'larry'"; $result = mysql_query($sql); if ($result == "") { echo "No result found"; } echo "Found"; Use isset.
if (!isset($result)) { echo "No result found"; }... Lori

« previous php.general (#252369) next »