codice:
$db=mysql_connect("localhost","........","........") or die(mysql_error());
mysql_select_db("nome_database",$db) or die(mysql_error());
$st=mysql_query("SHOW TABLE STATUS") or die(mysql_error());
$totale=0;
while($row=mysql_fetch_assoc($st)){
	$totale=$totale+$row['Data_length'] + $row['Index_length'];
}
echo "Dimensione database: ".round($totale/1024,2);