| Versionen | |
|---|---|
| drupal7 | DatabaseConnection::__construct($dsn, $username, $password, $driver_options = array()) |
includes/
<?php
function __construct($dsn, $username, $password, $driver_options = array()) {
// Because the other methods don't seem to work right.
$driver_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
// Call PDO::__construct and PDO::setAttribute.
parent::__construct($dsn, $username, $password, $driver_options);
// Set a specific PDOStatement class if the driver requires that.
if (!empty($this->statementClass)) {
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array($this->statementClass, array($this)));
}
}
?>
Kommentare
Kommentar hinzufügen