|
From: Bart v. B. <ba...@us...> - 2002-01-11 10:26:56
|
Update of /cvsroot/phpbb/phpBB2/admin
In directory usw-pr-cvs1:/tmp/cvs-serv19833
Modified Files:
index.php
Log Message:
Fixed problem with SHOW TABLE STATUS (bad MySQL config) #501745
Index: index.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/index.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** index.php 2002/01/01 18:59:50 1.31
--- index.php 2002/01/11 10:26:52 1.32
***************
*** 236,276 ****
$sql = "SHOW TABLE STATUS
FROM " . $db_name;
! if(!$result = $db->sql_query($sql))
{
! message_die(GENERAL_ERROR, "Couldn't obtain table information.", "", __LINE__, __FILE__, $sql);
! }
! $tabledata_ary = $db->sql_fetchrowset($result);
! $dbsize = 0;
! for($i = 0; $i < count($tabledata_ary); $i++)
! {
! if( $tabledata_ary[$i]['Type'] != "MRG_MyISAM" )
{
! 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'];
- }
}
- }
! 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
--- 236,275 ----
$sql = "SHOW TABLE STATUS
FROM " . $db_name;
! if($result = $db->sql_query($sql))
{
! $tabledata_ary = $db->sql_fetchrowset($result);
! $dbsize = 0;
! for($i = 0; $i < count($tabledata_ary); $i++)
{
! if( $tabledata_ary[$i]['Type'] != "MRG_MyISAM" )
{
! 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'];
}
}
}
! 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
***************
*** 569,571 ****
}
! ?>
\ No newline at end of file
--- 568,570 ----
}
! ?>
|