$result = mysql_query();
if (mysql_num_rows($result) $x)
-Kevin
- Original Message -
From: DonPro [EMAIL PROTECTED]
To: php list [EMAIL PROTECTED]
Sent: Wednesday, October 02, 2002 2:35 PM
Subject: [PHP] counting number of records in a MySQL table; how do I get the
result?
Hi,
I
$result = mysql_query();
if (mysql_num_rows($result) $x)
-Kevin
This won't work because a SELECT COUNT(*) query always returns a row,
even if it returns zero as the value.
$result = mysql_query(SELECT COUNT(*) FROM ... );
$count = mysql_result($result,0);
---John Holmes...
- Original
so why not take that resulting row, and then do an if on it to see if the
value is a zero? an extra step, but it would work
John W. Holmes [EMAIL PROTECTED] wrote in message
002c01c26a66$61f0e1a0$7c02a8c0@coconut">news:002c01c26a66$61f0e1a0$7c02a8c0@coconut...
$result = mysql_query();
if
3 matches
Mail list logo