mysql if empty



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";


----- Original Message ----- From: "Martin Marques" <martin@xxxxxxxxxxxxxxx>
To: "Stut" <stuttle@xxxxxxxxx>
Cc: "Tijnema !" <tijnema@xxxxxxxxx>; "tedd" <tedd@xxxxxxxxxxxx>; "Peter Lauri" <lists@xxxxxxxxxxx>; "Ólafur Waage" <sinai@xxxxxxxxx>; <php-general@xxxxxxxxxxxxx>
Sent: Monday, April 09, 2007 9:45 PM
Subject: Re: [PHP] Session Authentication


Stut escribió:
As with most things these days it probably breaches the DMCA. But frankly speaking, if doing that works then the developers of the application, and by extension the company, deserve everything they get.

DMCA is a real piece of crap.

--
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
---------------------------------------------------------
Martín Marqués | Programador, DBA
Centro de Telemática | Administrador
Universidad Nacional
del Litoral
---------------------------------------------------------

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



.



Relevant Pages

  • Re: [PHP] mysql if empty
    ... This doesn't meant that the variable holding the reference to the result set is itself empty, but that you will fail to fetch any results from it. ... echo "No result found"; ... PHP General Mailing List ... To unsubscribe, visit: http://www.php.net/unsub.php ...
    (php.general)
  • Re: Bash problems?
    ... How do I do to, within a scrip, check if a directory I empty or not. ... Cant find a way to do this in a simple way. ... echo "$DIR contains:" ...
    (Fedora)
  • Re: Bash problems?
    ... How do I do to, within a scrip, check if a directory I empty or not. ... Cant find a way to do this in a simple way. ... echo "$DIR contains:" ...
    (Fedora)
  • Re: [PHP] IPv6 validation
    ... echo "$ip is not a valid IP"; ... PHP General Mailing List ... I installed php5 on my local dev box years ago. ... my company to upgrade and fix code that busted in the transition. ...
    (php.general)
  • Wordpress <=2.0.2 cache shell injection
    ... if user registration is enabled, ... php files. ... DB_PASSWORD costant could be empty, ... echo 'No response from '.$host.':'.$port; die; ...
    (Bugtraq)