note 106714 deleted from function.mysql-num-rows by thiago
| From: | thiago@php.net | Date: | Wed, 30 Nov 2011 13:08:04 +0000 |
| Subject: | note 106714 deleted from function.mysql-num-rows by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-184821@lists.php.net to get a copy of this message | ||
Note Submitter: Ap.Muthu
----
If the result of a mysql_query() returns an empty recordset, then it needs to be checked with:
$sql="SELECT * FROM mytable";
$result=mysql_query($sql);
if (mysql_num_rows($result) == -) {
// Empty record set code
} else {
// Valid recordsets code
}