From 5bf88c6935f56bf5bb880a08d42f1fcc64d0a861 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Tue, 1 May 2012 07:52:09 +0000 Subject: [PATCH] * fix the error of hardcode table name. --- module/admin/control.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/admin/control.php b/module/admin/control.php index 06b769ca99..23769a1b07 100644 --- a/module/admin/control.php +++ b/module/admin/control.php @@ -101,7 +101,7 @@ class admin extends control } /** - * Repair all tables + * Check all tables. * * @access public * @return void @@ -109,10 +109,10 @@ class admin extends control public function checkDB() { $tables = $this->dbh->query('SHOW TABLES')->fetchAll(); - foreach($tables as $table) { - $result = $this->dbh->query("REPAIR TABLE `" . $table->Tables_in_zentao . "`")->fetch(); + $tableName = current((array)$table); + $result = $this->dbh->query("REPAIR TABLE $tableName")->fetch(); echo "Repairing TABLE: " . $result->Table . "\t" . $result->Msg_type . ":" . $result->Msg_text . "\n"; } }