Database Statistics '; $q_dbsize = mysql_query("SHOW table STATUS") or die(mysql_error()); $tot_size = 0; $tot_rows = 0; $max_size = 0; while ($r_dbsize = mysql_fetch_array($q_dbsize)) { if (substr($r_dbsize['Name'], 0, 4) != 'uts_') continue; $size = $r_dbsize['Data_length'] + $r_dbsize['Index_length']; $rows = $r_dbsize['Rows']; $tables[] = array ( 'name' => $r_dbsize['Name'], 'size' => $size, 'rows' => $rows ); $tot_size += $size; $tot_rows += $rows; if ($max_size < $size) $max_size = $size; } $i = 0; foreach($tables as $table) { $i++; $class = ($i%2) ? 'grey' : 'grey2'; $d_size = file_size_info($table['size']); $title = get_dp($table['size'] / $tot_size * 100) .' %'; echo' '; if (substr($table['name'], 0, 9) == 'uts_temp_' and strlen($table['name']) == 17) { echo 'Delete'.$table['name'].''; } else { echo $table['name']; } echo ' '.nf($table['rows']).' rows '.$d_size['size'] .' '. $d_size['type'].' '. $title .' '; } $d_size = file_size_info($tot_size); echo' Total Database Size '.nf($tot_rows).' rows '.$d_size['size'] .' '. $d_size['type'].'  
'; echo'
'; echo ' '; echo'
'; ?>