> I'm using php/mysql. I want to be able to count the number of records that
> match something.
> I've used mysql_num_rows() and it does work, but is there a better way?
> Something like COUNT(*)? I've tried to use it, but all I get is Resource
ID
> #1 or something similar. Any ideas for the best way to do this?
>
> Max

$result = mysql_db_query($database, "SELECT COUNT(*) AS count FROM table;");
$count = mysql_fetch_array($result);
echo $count["count"];

Luboslav Gabal


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to