diff --git a/dibi/drivers/mssql.php b/dibi/drivers/mssql.php index aa5ed0e1..aa7d82e9 100644 --- a/dibi/drivers/mssql.php +++ b/dibi/drivers/mssql.php @@ -320,18 +320,6 @@ class DibiMsSqlDriver extends NObject implements DibiDriverInterface - /** - * Converts database error to DibiDriverException - * - * @throws DibiDriverException - */ - protected function throwException($sql=NULL) - { - throw new DibiDriverException(); - } - - - /** * Returns the connection resource * diff --git a/dibi/drivers/postgre.php b/dibi/drivers/postgre.php index 1b137507..c24e7c0c 100644 --- a/dibi/drivers/postgre.php +++ b/dibi/drivers/postgre.php @@ -117,7 +117,7 @@ class DibiPostgreDriver extends NObject implements DibiDriverInterface $this->resultset = @pg_query($this->connection, $sql); if ($this->resultset === FALSE) { - $this->throwException($sql); + throw new DibiDriverException(pg_last_error($this->connection), 0, $sql); } return is_resource($this->resultset); @@ -326,18 +326,6 @@ class DibiPostgreDriver extends NObject implements DibiDriverInterface - /** - * Converts database error to DibiDriverException - * - * @throws DibiDriverException - */ - protected function throwException($sql=NULL) - { - throw new DibiDriverException(pg_last_error($this->connection), 0, $sql); - } - - - /** * Returns the connection resource * diff --git a/dibi/drivers/sqlite.php b/dibi/drivers/sqlite.php index b235bd4e..3f6ccc1d 100644 --- a/dibi/drivers/sqlite.php +++ b/dibi/drivers/sqlite.php @@ -120,16 +120,12 @@ class DibiSqliteDriver extends NObject implements DibiDriverInterface DibiDriverException::catchError(); if ($this->buffered) { - $this->resultset = sqlite_query($this->connection, $sql, SQLITE_ASSOC); + $this->resultset = sqlite_query($this->connection, $sql); } else { - $this->resultset = sqlite_unbuffered_query($this->connection, $sql, SQLITE_ASSOC); + $this->resultset = sqlite_unbuffered_query($this->connection, $sql); } DibiDriverException::restore(); - if (sqlite_last_error($this->connection)) { - $this->throwException(); - } - return is_resource($this->resultset); } @@ -303,19 +299,6 @@ class DibiSqliteDriver extends NObject implements DibiDriverInterface - /** - * Converts database error to DibiDriverException - * - * @throws DibiDriverException - */ - protected function throwException($sql=NULL) - { - $errno = sqlite_last_error($this->connection); - throw new DibiDriverException(sqlite_error_string($errno), $errno, $sql); - } - - - /** * Returns the connection resource * diff --git a/dibi/libs/DibiConnection.php b/dibi/libs/DibiConnection.php index 3e2c54e2..7e920188 100644 --- a/dibi/libs/DibiConnection.php +++ b/dibi/libs/DibiConnection.php @@ -419,15 +419,4 @@ class DibiConnection extends NObject throw new DibiException('You cannot serialize or unserialize '.__CLASS__.' instances'); } - - - /** - * Returns last error - * @deprecated - */ - public function errorInfo() - { - throw new BadMethodCallException(__METHOD__ . ' has been deprecated'); - } - } diff --git a/examples/sql-builder.php b/examples/sql-builder.php index 99bc84ff..b177bab9 100644 --- a/examples/sql-builder.php +++ b/examples/sql-builder.php @@ -30,7 +30,7 @@ $array3 = array( $array4 = array( 'a' => 12, 'b' => NULL, - 'c%t' => time(), // modifier 'T' means datetime + 'c' => dibi::datetime(), 'd' => 'any string', ); $array5 = array('RAND()', '[col1] > [col2]');