0) { // Get the valid databases list $num_dbs = count($dblist); $dbs = @mysql_list_dbs() or mysql_die(); while ($a_db = mysql_fetch_object($dbs)) { if (!$num_dbs) { $dblist[] = $a_db->Database; } else { $true_dblist[$a_db->Database] = ''; } } if ($num_dbs && empty($true_dblist)) { $dblist = array(); } else if ($num_dbs) { for ($i = 0; $i < $num_dbs; $i++) { if (isset($true_dblist[$dblist[$i]])) { $dblist_valid[] = $dblist[$i]; } } if (isset($dblist_valid)) { $dblist = $dblist_valid; unset($dblist_valid); } else { $dblist = array(); } unset($true_dblist); } // Get the valid databases count $num_dbs = count($dblist); } else { $num_dbs = 0; } /** * Send http headers */ // Don't use cache (required for Opera) $now = gmdate('D, d M Y H:i:s') . ' GMT'; header('Expires: ' . $now); header('Last-Modified: ' . $now); header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1 header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1 header('Pragma: no-cache'); // HTTP/1.0 // Define the charset to be used header('Content-Type: text/html; charset=' . $charset); /** * Displays the frame */ ?> phpMyAdmin

-

1) { $selected_db = 0; // Gets the tables list per database for ($i = 0; $i < $num_dbs; $i++) { $db = $dblist[$i]; $j = $i + 2; $bgcolor = ($i % 2) ? $cfgBgcolorOne : $cfgBgcolorTwo; if (!empty($db_start) && $db == $db_start) { $selected_db = $j; } $tables = @mysql_list_tables($db); $num_tables = @mysql_numrows($tables); $common_url_query = 'lang=' . $lang . '&server=' . urlencode($server) . '&db=' . urlencode($db); // get size of data and indexes $db_clean = backquote($db); $tot_data = 0; $tot_idx = 0; $tot_all = 0; $result = mysql_query("SHOW TABLE STATUS FROM $db_clean") or mysql_die(); if (mysql_num_rows($result)) { while ($row = mysql_fetch_array($result)) { $tot_data += $row['Data_length']; $tot_idx += $row['Index_length']; } $tot_all = $tot_data + $tot_idx; } list($tot_data_format,$unit_data) = format_byte_down($tot_data,3,1); list($tot_idx_format,$unit_idx) = format_byte_down($tot_idx,3,1); list($tot_all_format,$unit_all) = format_byte_down($tot_all,3,1); echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
" . urlencode($db) . " $tot_data_format $unit_data $tot_idx_format $unit_idx $tot_all_format $unit_all
"; } // end if ($num_dbs == 1) else { echo "\n"; echo '

' . $strNoDatabases . '

'; } // end if ($num_dbs == 0) echo "\n"; ?>