codice:
$sql="SELECT COUNT(*) FROM tabella"; 
$dati=mysql_query($sql); 
$ris=mysql_fetch_array($dati); 
echo $num = $ris[0];