From 1b61e78a1159a0cd4457d8e6fbfd8dc71304b8c3 Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Mon, 18 Jan 2016 17:02:46 +0100 Subject: [PATCH] fixing display of DB Size in MySQL. Fixes #31 --- bureau/class/m_mysql.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bureau/class/m_mysql.php b/bureau/class/m_mysql.php index 3971379f..8dcfd864 100644 --- a/bureau/class/m_mysql.php +++ b/bureau/class/m_mysql.php @@ -554,14 +554,12 @@ class m_mysql { * @access private */ function get_db_size($dbname) { - global $db; - $this->dbus->query("SHOW TABLE STATUS FROM `$dbname`;"); $size = 0; - while ($db->next_record()) { - $size += $db->f('Data_length') + $db->f('Index_length'); - if ($db->f('Engine') != 'InnoDB') { - $size += $db->f('Data_free'); + while ($this->dbus->next_record()) { + $size += $this->dbus->f('Data_length') + $this->dbus->f('Index_length'); + if ($this->dbus->f('Engine') != 'InnoDB') { + $size += $this->dbus->f('Data_free'); } } return $size;