RE: [PHP] Re: mysql
| From: | Tim Ward | Date: | Thu, 11 Apr 2002 08:02:15 +0000 |
| Subject: | RE: [PHP] Re: mysql | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-92522@lists.php.net to get a copy of this message | ||
That's not quite right,
if (!$result = mysql_query($sql, $db))
{ echo "Query failed";
} else
{ if (!$row = mysql_fetch_row($result))
{ echo "No records found.";
}
}
Tim Ward
Internet Chess www.chessish.com <http://www.chessish.com>
----------
From: Erik Price [SMTP:pricee@hhbrown.com]
Sent: 10 April 2002 15:00
To: php-general@lists.php.net
Subject: Re: [PHP] Re: mysql
...
Someone did suggest that you use an if statement, however, in the
event
that no records are retrieved --
if (!$result = mysql_query($sql, $db)) {
echo "No records found.";
} else {
$row = mysql_fetch_row($result);
}
Erik
----
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
pricee@hhbrown.com