diff options
author | Stanislau <stanislau.wolski@gmail.com> | 2011-07-21 13:02:37 +0300 |
---|---|---|
committer | Stanislau <stanislau.wolski@gmail.com> | 2011-07-21 13:02:37 +0300 |
commit | fa88b71d3883981b6b4353b3e18825c22a39d3d7 (patch) | |
tree | 2ad4fb4a37a3407877ee2662019af8005d247d5d /codebase/db_sqlite3.php | |
parent | 5c2afae6cf595c981155ac68501ac2d1af77db54 (diff) | |
download | connector-php-fa88b71d3883981b6b4353b3e18825c22a39d3d7.zip connector-php-fa88b71d3883981b6b4353b3e18825c22a39d3d7.tar.gz connector-php-fa88b71d3883981b6b4353b3e18825c22a39d3d7.tar.bz2 |
[add] Adapter for SQLite3 connection type
Diffstat (limited to 'codebase/db_sqlite3.php')
-rw-r--r-- | codebase/db_sqlite3.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/codebase/db_sqlite3.php b/codebase/db_sqlite3.php new file mode 100644 index 0000000..de284cf --- /dev/null +++ b/codebase/db_sqlite3.php @@ -0,0 +1,33 @@ +<?php +/* + @author dhtmlx.com + @license GPL, see license.txt +*/ +require_once("db_common.php"); +/*! SQLite implementation of DataWrapper +**/ +class SQLite3DBDataWrapper extends DBDataWrapper{ + + public function query($sql){ + LogMaster::log($sql); + + $res = $this->connection->query($sql); + if ($res === false) + throw new Exception("SQLLite - sql execution failed\n".$this->connection->lastErrorMsg()); + + return $res; + } + + public function get_next($res){ + return $res->fetchArray(); + } + + protected function get_new_id(){ + return $this->connection->lastInsertRowID(); + } + + public function escape($data){ + return $this->connection->escapeString($data); + } +} +?>
\ No newline at end of file |