codice:
$query = "SELECT COUNT(*) AS totale FROM table";
$st=mysql_query($query) or die(mysql_error());
$row=mysql_fetch_assoc($st);
echo $row['totale'];