From d0fc019d7f82d6befe47ea345886223db1101fe3 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 10 Feb 2010 08:31:48 -0500
Subject: [PATCH] 

---
 server/lib/classes/db_mysql.inc.php |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/server/lib/classes/db_mysql.inc.php b/server/lib/classes/db_mysql.inc.php
index 672de7f..364fd7e 100644
--- a/server/lib/classes/db_mysql.inc.php
+++ b/server/lib/classes/db_mysql.inc.php
@@ -52,6 +52,7 @@
 			$this->dbName = $conf["db_database"];
 			$this->dbUser = $conf["db_user"];
 			$this->dbPass = $conf["db_password"];
+			$this->dbCharset = $conf['db_charset'];
 			//$this->connect();
 		}
 
@@ -59,8 +60,8 @@
 		function updateError($location)
 		{
 			global $app;
-			$this->errorNumber = mysql_errno();
-			$this->errorMessage = mysql_error();
+			$this->errorNumber = mysql_errno($this->linkId);
+			$this->errorMessage = mysql_error($this->linkId);
 			$this->errorLocation = $location;
 			if($this->errorNumber && $this->show_error_messages && method_exists($app,'log'))
 			{
@@ -80,6 +81,8 @@
 					$this->updateError('DB::connect()-> mysql_connect');
 					return false;
 				}
+				$this->queryId = @mysql_query('SET NAMES '.$this->dbCharset, $this->linkId);
+				$this->queryId = @mysql_query("SET character_set_results = '".$this->dbCharset."', character_set_client = '".$this->dbCharset."', character_set_connection = '".$this->dbCharset."', character_set_database = '".$this->dbCharset."', character_set_server = '".$this->dbCharset."'", $this->linkId);
 			}
 			return true;
 		}
@@ -189,7 +192,8 @@
 		return $out;
 		}
        
-       
+       /*
+	   //* These functions are deprecated and will be removed.
        function insert($tablename,$form,$debug = 0)
        {
          if(is_array($form)){
@@ -224,6 +228,7 @@
       		 if($debug == 1) echo "mySQL Error Message: ".$this->errorMessage;
            }
        }
+	   */
        
        public function closeConn()
     	{

--
Gitblit v1.9.1