/**
  * Create a Connection to an Oracle Database using oci8 extension.
  *
  * @param string $username
  * @param string $password
  * @param string $db
  */
 public function __construct($db, $charset = null)
 {
     $this->dbh = new \SQLite3($db);
     if (!$this->dbh) {
         throw SQLite3Exception::fromErrorInfo(array('message' => $this->dbh->lastErrorMsg(), 'code' => $this->dbh->lastErrorCode()));
     }
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function execute($params = null)
 {
     if ($params) {
         $hasZeroIndex = array_key_exists(0, $params);
         foreach ($params as $key => $val) {
             if ($hasZeroIndex && is_numeric($key)) {
                 $this->bindValue($key + 1, $val);
             } else {
                 $this->bindValue($key, $val);
             }
         }
     }
     $this->_ret = $this->_sth->execute();
     if (!$this->_ret) {
         throw SQLite3Exception::fromErrorInfo($this->errorInfo());
     }
     return $this->_ret;
 }