aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/admin/index.php
diff options
context:
space:
mode:
authorBart van Bragt <bartvb@users.sourceforge.net>2002-01-11 10:26:52 +0000
committerBart van Bragt <bartvb@users.sourceforge.net>2002-01-11 10:26:52 +0000
commit4c3a11f577b63b5efed257bf7dbb4239aca7c179 (patch)
treeb6f831e4abde0c4054063f7f711150c7b3b960ed /phpBB/admin/index.php
parentd728809a4c8fcd2e1a491eb866732cf7390ee041 (diff)
downloadforums-4c3a11f577b63b5efed257bf7dbb4239aca7c179.tar
forums-4c3a11f577b63b5efed257bf7dbb4239aca7c179.tar.gz
forums-4c3a11f577b63b5efed257bf7dbb4239aca7c179.tar.bz2
forums-4c3a11f577b63b5efed257bf7dbb4239aca7c179.tar.xz
forums-4c3a11f577b63b5efed257bf7dbb4239aca7c179.zip
Fixed problem with SHOW TABLE STATUS (bad MySQL config) #501745
git-svn-id: file:///svn/phpbb/trunk@1840 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/admin/index.php')
-rw-r--r--phpBB/admin/index.php55
1 files changed, 27 insertions, 28 deletions
diff --git a/phpBB/admin/index.php b/phpBB/admin/index.php
index 9df371f21c..bb09f72f76 100644
--- a/phpBB/admin/index.php
+++ b/phpBB/admin/index.php
@@ -235,43 +235,42 @@ elseif( $HTTP_GET_VARS['pane'] == 'right' )
$sql = "SHOW TABLE STATUS
FROM " . $db_name;
- if(!$result = $db->sql_query($sql))
+ if($result = $db->sql_query($sql))
{
- message_die(GENERAL_ERROR, "Couldn't obtain table information.", "", __LINE__, __FILE__, $sql);
- }
- $tabledata_ary = $db->sql_fetchrowset($result);
+ $tabledata_ary = $db->sql_fetchrowset($result);
- $dbsize = 0;
- for($i = 0; $i < count($tabledata_ary); $i++)
- {
- if( $tabledata_ary[$i]['Type'] != "MRG_MyISAM" )
+ $dbsize = 0;
+ for($i = 0; $i < count($tabledata_ary); $i++)
{
- if( $table_prefix != "" )
+ if( $tabledata_ary[$i]['Type'] != "MRG_MyISAM" )
{
- if( strstr($tabledata_ary[$i]['Name'], $table_prefix) )
+ if( $table_prefix != "" )
+ {
+ if( strstr($tabledata_ary[$i]['Name'], $table_prefix) )
+ {
+ $dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length'];
+ }
+ }
+ else
{
$dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length'];
}
}
- else
- {
- $dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length'];
- }
}
- }
- if( $dbsize >= 1048576 )
- {
- $dbsize = sprintf("%.2f MB", ( $dbsize / 1048576 ));
- }
- else if( $dbsize >= 1024 )
- {
- $dbsize = sprintf("%.2f KB", ( $dbsize / 1024 ));
- }
- else
- {
- $dbsize = sprintf("%.2f Bytes", $dbsize);
- }
+ if( $dbsize >= 1048576 )
+ {
+ $dbsize = sprintf("%.2f MB", ( $dbsize / 1048576 ));
+ }
+ else if( $dbsize >= 1024 )
+ {
+ $dbsize = sprintf("%.2f KB", ( $dbsize / 1024 ));
+ }
+ else
+ {
+ $dbsize = sprintf("%.2f Bytes", $dbsize);
+ }
+ } // Else we couldn't get the table status.
}
else
{
@@ -568,4 +567,4 @@ else
}
-?> \ No newline at end of file
+?>