$conn=mysql_connect('localhost','root','');
mysql_select_db('database',$conn);
$sql="SELECT information_schema.TABLES.TABLE_NAME FROM information_schema. TABLES WHERE table_schema = 'database'";
$res=mysql_query($sql);
while ($result = mysql_fetch_assoc($res) ) {
$tables[]=$result['TABLE_NAME'];
};
echo "
< ;td>Table name
Data volume |
";
foreach ($tables as $k=>$v) {
$sql_count="select count(id) AS nums,'".$v."' from ".$tables[$k];
$res_count=mysql_query($sql_count);
$ result_count = mysql_fetch_assoc($res_count);
echo "".$result_count[$v].' | '.$result_count['nums']. ' |
';
}
echo "
"
?>