Essayez ceci :
list($count) = mysql_fetch_row(mysql_query("select count(*) from `test`"));
echo $count;
Sinon, si vous exécutez déjà une requête pour obtenir des commentaires, vous pouvez essayer ceci :
$sql = mysql_query("select sql_calc_found_rows * from `test` order by `id` desc limit 10");
// ^ Get the 10 most recent comments
list($count) = mysql_fetch_row(mysql_query("select found_rows()"));
// this avoids having to run the entire query again, great for efficiency!
while($comment = mysql_fetch_assoc($sql)) var_dump($comment); // just an example