Hello, I have a database with 30 tables, I would like to count the total number of records with the shortest # of queries. I can count them by select count(*) from individual table and add them up but that would take too many queries. Is there a faster way out there? thanks
<?php mysql_connect("localhost","root",""); $result = mysql_query("SHOW TABLE STATUS FROM test;"); while($array = mysql_fetch_array($result)) { $total = $array[Data_length]+$array[Index_length]; echo ' Table: '.$array[Name].'<br /> Data Size: '.$array[Data_length].'<br /> Index Size: '.$array[Index_length].'<br /> Total Size: '.$total.'<br /> Total Rows: '.$array[Rows].'<br /> Average Size Per Row: '.$array[Avg_row_length].'<br /><br /> '; } ?>