Re: mysql if empty

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



chris@xxxxxxxxxxxx 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";


----- 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:  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





$sql = "SELECT Client FROM booked WHERE Name = 'larry'";

$result = mysql_query($sql) OR die('[MYSQL ERROR] - ['.mysql_errno().']<br />'.mysql_error());

while ( list($client) = mysql_fetch_row($result) ) {
	echo "{$client}<br />\n";
}


--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different strings. But there are times for you and me when all such things agree.

- Rush

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux