From be8d2fca2844072a58bfb42eab009b757d549229 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 28 May 2019 10:49:32 -0700 Subject: [PATCH] Fixes #3800 Issue with DB structure update and database name containing hyphens. --- e107_handlers/e_db_pdo_class.php | 2 +- e107_handlers/mysql_class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/e107_handlers/e_db_pdo_class.php b/e107_handlers/e_db_pdo_class.php index 70830f370..096a06e6e 100644 --- a/e107_handlers/e_db_pdo_class.php +++ b/e107_handlers/e_db_pdo_class.php @@ -2161,7 +2161,7 @@ class e_db_pdo implements e_db private function _getTableList($language='') { - $database = !empty($this->mySQLdefaultdb) ? "FROM ".$this->mySQLdefaultdb : ""; + $database = !empty($this->mySQLdefaultdb) ? "FROM `".$this->mySQLdefaultdb."`" : ""; $prefix = $this->mySQLPrefix; if(strpos($prefix, ".") !== false) // eg. `my_database`.$prefix diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php index ecad1804a..f559abba8 100644 --- a/e107_handlers/mysql_class.php +++ b/e107_handlers/mysql_class.php @@ -2552,7 +2552,7 @@ class e_db_mysql private function db_mySQLtableList($language='') { - $database = !empty($this->mySQLdefaultdb) ? "FROM ".$this->mySQLdefaultdb : ""; + $database = !empty($this->mySQLdefaultdb) ? "FROM `".$this->mySQLdefaultdb."`" : ""; $prefix = $this->mySQLPrefix; if(strpos($prefix, ".") !== false) // eg. `my_database`.$prefix