<?php
$total = 0;
mysql_connect("localhost", "root", "");
$db = "dbjoomla";
mysql_select_db($db);
$r1 = mysql_query("show tables");
while ($ro1 = mysql_fetch_array($r1)) {
$table = $ro1[0];
$r2 = mysql_query("select count(*) from `$table`");
$ro2 = mysql_fetch_array($r2);
$rn = $ro2[0];
$total += $rn;
//echo "`$db`.`$table`: $rn records\n";
}
mysql_free_result($r1);
mysql_free_result($r2);
echo "Database `$db` has total $total records";
?>