From cdaeaf9b8f83fd9b2a92a7c472763a49bed0a87d Mon Sep 17 00:00:00 2001 From: "Christophe.Boulain" <> Date: Tue, 12 Jan 2010 10:27:34 +0000 Subject: Fixed issue#208 --- HISTORY | 1 + framework/Data/TDbConnection.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/HISTORY b/HISTORY index 4351dfa9..b05836ee 100644 --- a/HISTORY +++ b/HISTORY @@ -8,6 +8,7 @@ BUG: Issue#188 - TDbCache doesn't check if db connection is active. (Yves) BUG: Issue#189 - Page State corrupted when EnableStateValidation=False (Christophe) BUG: Issue#191 - Bad parsing of MySQL ENUM type column (Yves) BUG: Issue#198 - "Undefined variable: tagName" after error in application configuration. (Christophe) +BUG: Issue#208 - TDbConnection.Charset not working properly (googlenew at pcforum.hu, Christophe) BUG: Issue#216 - TTabPanel doesn't preserve active tab on callback request (googlenew at pcforum.hu,Christophe) BUG: Typo in TBoundColumn (Robin) ENH: Add property ClientScriptManagerClass to TPageService and releated changes in TPage.getClientScript() (Yves) diff --git a/framework/Data/TDbConnection.php b/framework/Data/TDbConnection.php index 26d61883..6b84e1b3 100644 --- a/framework/Data/TDbConnection.php +++ b/framework/Data/TDbConnection.php @@ -167,9 +167,9 @@ class TDbConnection extends TComponent try { $this->_pdo=new PDO($this->getConnectionString(),$this->getUsername(), - $this->getPassword(),$this->_attributes); - // This attribute is only useful for PDO::MySql driver. - // Ignore the warning if a driver doesn't understand this. + $this->getPassword(),$this->_attributes); + // This attribute is only useful for PDO::MySql driver. + // Ignore the warning if a driver doesn't understand this. @$this->_pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); $this->_pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $this->_active=true; @@ -204,7 +204,7 @@ class TDbConnection extends TComponent switch ($this->_pdo->getAttribute(PDO::ATTR_DRIVER_NAME)) { case 'mysql': - $stmt = $this->_pdo->prepare('SET CHARACTER SET ?'); + $stmt = $this->_pdo->prepare('SET NAMES ?'); break; case 'pgsql': $stmt = $this->_pdo->prepare('SET client_encoding TO ?'); -- cgit v1.2.3