* db_stats.php3: fixed the sql query so that the script won't
die, even if the result of one query (for example on invalid db name) fails.
This commit is contained in:
@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
|
||||
$Id$
|
||||
$Source$
|
||||
|
||||
2001-08-28 Olivier M<>ller <om@omnis.ch>
|
||||
* db_stats.php3: fixed the sql query so that the script won't
|
||||
die, even if the result of one query (for example on invalid
|
||||
db name) fails.
|
||||
|
||||
2001-08-27 Robin Johnson <robbat2@orbis-terrarum.net>
|
||||
* lib.inc.php3, db_readdump.php3
|
||||
- removed expand_sql_query() as no longer needed
|
||||
|
@@ -136,7 +136,7 @@ if ($num_dbs > 1) {
|
||||
$tot_idx = 0;
|
||||
$tot_all = 0;
|
||||
$local_query = 'SHOW TABLE STATUS FROM ' . $db_clean;
|
||||
$result = mysql_query($local_query) or mysql_die('', $local_query);
|
||||
if ($result = @mysql_query($local_query)) {
|
||||
if (mysql_num_rows($result)) {
|
||||
while ($row = mysql_fetch_array($result)) {
|
||||
$tot_data += $row['Data_length'];
|
||||
@@ -148,13 +148,14 @@ if ($num_dbs > 1) {
|
||||
$big_tot_data += $tot_data;
|
||||
$results_array[$db] = $tot_all;
|
||||
}
|
||||
}
|
||||
|
||||
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 ' <tr bgcolor="'. $bgcolor . '">' . "\n";
|
||||
echo ' <td> ' . urlencode($db) . ' </td>' . "\n";
|
||||
echo ' <td> ' . htmlentities($db) . ' </td>' . "\n";
|
||||
echo ' <td align="right"> ' . $num_tables . ' </td>' . "\n";
|
||||
echo ' <td align="right"> ' . $tot_data_format . ' ' . $unit_data . ' </td>' . "\n";
|
||||
echo ' <td align="right"> ' . $tot_idx_format . ' ' . $unit_idx . ' </td>' . "\n";
|
||||
@@ -168,7 +169,7 @@ if ($num_dbs > 1) {
|
||||
list($tot_all_format,$unit_all) = format_byte_down($big_tot_all,3,1);
|
||||
|
||||
echo ' <tr>' . "\n";
|
||||
echo ' <th> ' . $strSum . ' </th>' . "\n";
|
||||
echo ' <th> ' . $strSum . ': ' . $num_dbs . '</th>' . "\n";
|
||||
echo ' <th align="right"> ' . $tot_tables . ' </th>' . "\n";
|
||||
echo ' <th align="right"> ' . $tot_data_format . ' ' . $unit_data . ' </th>' . "\n";
|
||||
echo ' <th align="right"> ' . $tot_idx_format . ' ' . $unit_idx . ' </th>' . "\n";
|
||||
|
Reference in New Issue
Block a user