From b5157e70cb79dd42e9b4c384e6769c6055822b84 Mon Sep 17 00:00:00 2001
From: Cameron <e107inc@gmail.com>
Date: Thu, 6 Sep 2018 11:20:43 -0700
Subject: [PATCH] Fixes #3422 Installation issue with database names containing
 a hyphen.

---
 e107_handlers/mysql_class.php | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php
index 629a03a86..fff41f627 100644
--- a/e107_handlers/mysql_class.php
+++ b/e107_handlers/mysql_class.php
@@ -194,11 +194,6 @@ class e_db_mysql
 				list($this->mySQLserver,$this->mySQLport) = explode(':',$mySQLserver,2);
 			}
 
-		//	if($this->mySQLserver === 'localhost') // problematic.
-			{
-		//		$this->mySQLserver = '127.0.0.1';  // faster by almost 1 second
-			}
-
 			try
 			{
 				$this->mySQLaccess = new PDO("mysql:host=".$this->mySQLserver."; port=".$this->mySQLport, $this->mySQLuser, $this->mySQLpassword, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
@@ -371,7 +366,7 @@ class e_db_mysql
 
 			try
 			{
-				$this->mySQLaccess->query("use ".$database);
+				$this->mySQLaccess->query("use `".$database."`");
         		// $this->mySQLaccess->select_db($database); $dbh->query("use newdatabase");
 		    }
 			catch (PDOException $e) 
@@ -1468,7 +1463,8 @@ class e_db_mysql
 	  }
 	  else
 	  {
-		$this->dbError("db_Update ($query)");
+	    $query = 'UPDATE '.$this->mySQLPrefix.$table.' SET '.$new_data.$vars.' '.$arg;
+		$this->dbError("Error in deprecated db_UpdateArray method query:($query)");
 		return FALSE;
 	  }
 	}