public function QPDB::dbInit in QueryPath 6
Same name and namespace in other branches
- 7.3 QueryPath/Extension/QPDB.php \QPDB::dbInit()
- 7.2 QueryPath/Extension/QPDB.php \QPDB::dbInit()
File
- QueryPath/
Extension/ QPDB.php, line 47
Class
Code
public function dbInit($dsn, $options = array()) {
$this->opts = $options + array(
'username' => NULL,
'password' => NULL,
'db params' => array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
),
);
$this->dsn = $dsn;
$this->db = new PDO($dsn, $this->opts['username'], $this->opts['password'], $this->opts['db params']);
return $this->qp;
}