Re: mysql_num_rows
| From: | John Taylor-Johnston | Date: | Wed, 18 Dec 2002 06:17:27 +0000 |
| Subject: | Re: mysql_num_rows | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128654@lists.php.net to get a copy of this message | ||
I use $mycounter, not saying it is pretty. But if you have a whole bunch of stuff deleted, your last
id might be worth a lot more than the actual number of rows.
$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);
$news = mysql_query('select * from '.$table.' where '.$where.' order by id
asc');
$mycounter = 0;
while ($mydata = mysql_fetch_object($news))
{
$mycounter++;
}