$sql = "SHOW TABLE STATUS"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { $total = $row['Data_length']+$row['Index_length']; } echo($total);