From dd4cf1c960be47d6965f469d5527f96f05bc6297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Wed, 11 Jul 2001 19:20:56 +0000 Subject: [PATCH] Fixed some bugs with php3 (0 != empty) --- db_details.php3 | 19 +++++++++++-------- tbl_properties.php3 | 10 ++++++---- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/db_details.php3 b/db_details.php3 index e3e992966..bcee0933d 100755 --- a/db_details.php3 +++ b/db_details.php3 @@ -83,7 +83,7 @@ else if (MYSQL_MAJOR_VERSION >= 3.23 && isset($tbl_cache)) { - + = 3.23 && isset($tbl_cache)) { 0) list($formated_size, $unit) = format_byte_down($tblsize, 3, 1); - else list($formated_size, $unit) = format_byte_down($tblsize, 3, 0); + $tblsize = $sts_data['Data_length'] + $sts_data['Index_length']; + $sum_size += $tblsize; + $sum_entries += $sts_data['Rows']; + if ($tblsize > 0) { + list($formated_size, $unit) = format_byte_down($tblsize, 3, 1); + } else { + list($formated_size, $unit) = format_byte_down($tblsize, 3, 0); + } ?> @@ -135,7 +138,7 @@ else if (MYSQL_MAJOR_VERSION >= 3.23 && isset($tbl_cache)) { } else { ?> - + = 3.23 && isset($tbl_cache)) { ?> - + diff --git a/tbl_properties.php3 b/tbl_properties.php3 index 2d1536083..9682d7eb1 100755 --- a/tbl_properties.php3 +++ b/tbl_properties.php3 @@ -252,12 +252,14 @@ if (MYSQL_MAJOR_VERSION == "3.23" && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_typ // Gets some sizes list($data_size, $data_unit) = format_byte_down($showtable['Data_length']); list($index_size, $index_unit) = format_byte_down($showtable['Index_length']); - if (!empty($showtable['Data_free'])) { + if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) { list($free_size, $free_unit) = format_byte_down($showtable['Data_free']); } list($effect_size, $effect_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']); list($tot_size, $tot_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length']); - if (isset($showtable['Rows']) && $showtable['Rows']>0) list($avg_size, $avg_unit) = format_byte_down(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1); + if (isset($showtable['Rows']) && $showtable['Rows']>0) { + list($avg_size, $avg_unit) = format_byte_down(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1); + } // Displays them if ($index_count > 0) { @@ -285,7 +287,7 @@ if (MYSQL_MAJOR_VERSION == "3.23" && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_typ @@ -309,7 +311,7 @@ if (MYSQL_MAJOR_VERSION == "3.23" && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_typ