Allora puoi interrogare il DB "information_schema", c'è una tebella, si chiama "tables", contiene tutte le informazioni su tutti i db presenti.

Puoi fare così:
Codice PHP:
$query "SELECT table_rows FROM tables WHERE table_schema='nome_db_che_ti_interessa'";
$result mysql_query($query);

$tot 0;
while(
$row mysql_fetch_array($result)) {
    
$tot $tot $row[0];
}

echo 
$tot//dovrebbe dirti il numenro di record totali del db che hai indicato nella query