RE: [PHP] mysql_numrows
| From: | Sam Masiello | Date: | Mon, 06 Aug 2001 13:43:09 +0000 |
| Subject: | RE: [PHP] mysql_numrows | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-61416@lists.php.net to get a copy of this message | ||
I believe the function you want is mysql_num_rows, not mysql_numrows
HTH
Sam Masiello
Software Quality Assurance Engineer
Synacor
(716) 853-1362 x289
smasiello@synacor.com
-----Original Message-----
From: AJDIN BRANDIC [mailto:abrandic@coventry.ac.uk]
Sent: Monday, August 06, 2001 9:35 AM
To: php-general@lists.php.net
Subject: [PHP] mysql_numrows
Hi
I'm trying to get number of rows from a query. All works fine until
the result is 0. Then query executes fine, returns 0 rows but mysql_numrows
failes.
$query="select * from mytable";
$result=mysql_query($query) or die("select failed");
$num_rows=mysql_numrows($result) or die("select count failed");
Displays "selec count failed" but it should just return 0 so $numrows=0.
If "or die" bit is removed, then all works fine.
Any way around this problem?
Regards
Ajdin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net