From 9c6d553850d962105fd1452d642913cc30b61770 Mon Sep 17 00:00:00 2001 From: tof <> Date: Wed, 27 Aug 2008 15:06:25 +0000 Subject: Fixed a little bug introduced with [2495] when PDO driver doesn't allow settings of some attributes --- framework/Data/TDbConnection.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'framework/Data') diff --git a/framework/Data/TDbConnection.php b/framework/Data/TDbConnection.php index 5489c7fd..259ca7b7 100644 --- a/framework/Data/TDbConnection.php +++ b/framework/Data/TDbConnection.php @@ -167,9 +167,11 @@ class TDbConnection extends TComponent try { $this->_pdo=new PDO($this->getConnectionString(),$this->getUsername(), - $this->getPassword(),$this->_attributes); + $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->_pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); $this->_active=true; $this->setConnectionCharset(); } -- cgit v1.2.3