* 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$
|
$Id$
|
||||||
$Source$
|
$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>
|
2001-08-27 Robin Johnson <robbat2@orbis-terrarum.net>
|
||||||
* lib.inc.php3, db_readdump.php3
|
* lib.inc.php3, db_readdump.php3
|
||||||
- removed expand_sql_query() as no longer needed
|
- removed expand_sql_query() as no longer needed
|
||||||
|
@@ -136,17 +136,18 @@ if ($num_dbs > 1) {
|
|||||||
$tot_idx = 0;
|
$tot_idx = 0;
|
||||||
$tot_all = 0;
|
$tot_all = 0;
|
||||||
$local_query = 'SHOW TABLE STATUS FROM ' . $db_clean;
|
$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)) {
|
if (mysql_num_rows($result)) {
|
||||||
while ($row = mysql_fetch_array($result)) {
|
while ($row = mysql_fetch_array($result)) {
|
||||||
$tot_data += $row['Data_length'];
|
$tot_data += $row['Data_length'];
|
||||||
$tot_idx += $row['Index_length'];
|
$tot_idx += $row['Index_length'];
|
||||||
}
|
}
|
||||||
$tot_all = $tot_data + $tot_idx;
|
$tot_all = $tot_data + $tot_idx;
|
||||||
$big_tot_all += $tot_all;
|
$big_tot_all += $tot_all;
|
||||||
$big_tot_idx += $tot_idx;
|
$big_tot_idx += $tot_idx;
|
||||||
$big_tot_data += $tot_data;
|
$big_tot_data += $tot_data;
|
||||||
$results_array[$db] = $tot_all;
|
$results_array[$db] = $tot_all;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
list($tot_data_format,$unit_data) = format_byte_down($tot_data,3,1);
|
list($tot_data_format,$unit_data) = format_byte_down($tot_data,3,1);
|
||||||
@@ -154,7 +155,7 @@ if ($num_dbs > 1) {
|
|||||||
list($tot_all_format,$unit_all) = format_byte_down($tot_all,3,1);
|
list($tot_all_format,$unit_all) = format_byte_down($tot_all,3,1);
|
||||||
|
|
||||||
echo ' <tr bgcolor="'. $bgcolor . '">' . "\n";
|
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"> ' . $num_tables . ' </td>' . "\n";
|
||||||
echo ' <td align="right"> ' . $tot_data_format . ' ' . $unit_data . ' </td>' . "\n";
|
echo ' <td align="right"> ' . $tot_data_format . ' ' . $unit_data . ' </td>' . "\n";
|
||||||
echo ' <td align="right"> ' . $tot_idx_format . ' ' . $unit_idx . ' </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);
|
list($tot_all_format,$unit_all) = format_byte_down($big_tot_all,3,1);
|
||||||
|
|
||||||
echo ' <tr>' . "\n";
|
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_tables . ' </th>' . "\n";
|
||||||
echo ' <th align="right"> ' . $tot_data_format . ' ' . $unit_data . ' </th>' . "\n";
|
echo ' <th align="right"> ' . $tot_data_format . ' ' . $unit_data . ' </th>' . "\n";
|
||||||
echo ' <th align="right"> ' . $tot_idx_format . ' ' . $unit_idx . ' </th>' . "\n";
|
echo ' <th align="right"> ' . $tot_idx_format . ' ' . $unit_idx . ' </th>' . "\n";
|
||||||
|
Reference in New Issue
Block a user