Io farei così

Codice PHP:
$query "SELECT * FROM tabella";    
    
$result mysql_query($query) or die (mysql_error());    
    
$totalrows mysql_num_rows($result);    
    echo 
$totalrows

Facile e veloce