summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortof <>2008-08-27 15:06:25 +0000
committertof <>2008-08-27 15:06:25 +0000
commit9c6d553850d962105fd1452d642913cc30b61770 (patch)
tree22c0a64855ae054ec7f980d2a1432c8512bd9f00
parent32e444a8947566d4614082bc882c1de71f3576cc (diff)
Fixed a little bug introduced with [2495] when PDO driver doesn't allow settings of some attributes
-rw-r--r--framework/Data/TDbConnection.php6
1 files changed, 4 insertions, 2 deletions
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();
}