summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();
}