fixing display of DB Size in MySQL. Fixes #31

This commit is contained in:
Benjamin Sonntag 2016-01-18 17:02:46 +01:00
parent 8e1e99b067
commit 1b61e78a11
1 changed files with 4 additions and 6 deletions

View File

@ -554,14 +554,12 @@ class m_mysql {
* @access private * @access private
*/ */
function get_db_size($dbname) { function get_db_size($dbname) {
global $db;
$this->dbus->query("SHOW TABLE STATUS FROM `$dbname`;"); $this->dbus->query("SHOW TABLE STATUS FROM `$dbname`;");
$size = 0; $size = 0;
while ($db->next_record()) { while ($this->dbus->next_record()) {
$size += $db->f('Data_length') + $db->f('Index_length'); $size += $this->dbus->f('Data_length') + $this->dbus->f('Index_length');
if ($db->f('Engine') != 'InnoDB') { if ($this->dbus->f('Engine') != 'InnoDB') {
$size += $db->f('Data_free'); $size += $this->dbus->f('Data_free');
} }
} }
return $size; return $size;