<?
$conn = mysql_connect ("localhost", "username", "password") or die ("Could not connect");
$db = mysql_select_db("databasename");
$sql = "show table status like 'tablename';";
$result = mysql_query($sql);
$data = mysql_fetch_array($result);
$total = $data['Index_length'] + $data['Data_length'];
echo "Total size of $table in bytes : ".$total."
";
?>