note 17281 added to function.mysql-error
| From: | jason at cold-coffee dot com | Date: | Mon, 03 Dec 2001 10:32:03 +0000 |
| Subject: | note 17281 added to function.mysql-error | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-21554@lists.php.net to get a copy of this message | ||
<B>PLEASE NOTE</B>
Do not use this function to error check the returning of rows froma MySQL result (resource ID).
$rowcount = mysql_num_rows($result)or Die (mysql_error());
If there are no rows returned, the integer returned by mysql_num_rows = 0.
Therefore this will not produce any MySQL error becaus enothing went wrong. But because there are no
rows returned, the script will end there.
Just a note to take on board :-)
--
http://www.php.net/manual/en/function.mysql-error.php
http://master.php.net/manage/user-notes.php?action=edit+17281
http://master.php.net/manage/user-notes.php?action=delete+17281
http://master.php.net/manage/user-notes.php?action=reject+17281