If running MySQL, you could use "SHOW TABLE STATUS", e.g.:
<?php
$total = 0;
$connx = mysql_connect('localhost','userid','password') or die('connect');
$sql = "SHOW TABLE STATUS FROM `test`";
$result = mysql_query($sql) or die(mysql_error());
echo "<ul>\n";
while($row = mysql_fetch_assoc($result))
{
printf("<li>%s: %s", $row['Name'], $row['Data_length']);
$total += $row['Data_length'];
}
echo "</ul>\n";
echo "<p>Total: $total</p>\n";
?>
Outputs something like:
ai: 16384
computers: 16384
products: 360
skills: 48
test: 16384
word_list: 7550628
Total: 7600228