summaryrefslogtreecommitdiffstats
path: root/codebase/db_sqlite.php
diff options
context:
space:
mode:
authorMaksim <max@dhtmlx.com>2011-07-18 18:21:10 +0300
committerMaksim <max@dhtmlx.com>2011-07-18 18:21:10 +0300
commit5c2afae6cf595c981155ac68501ac2d1af77db54 (patch)
treeb07de6379fb3eb540df732a57061cafd05288599 /codebase/db_sqlite.php
downloadconnector-php-5c2afae6cf595c981155ac68501ac2d1af77db54.zip
connector-php-5c2afae6cf595c981155ac68501ac2d1af77db54.tar.gz
connector-php-5c2afae6cf595c981155ac68501ac2d1af77db54.tar.bz2
* import of php connector v1.2
Diffstat (limited to 'codebase/db_sqlite.php')
-rw-r--r--codebase/db_sqlite.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/codebase/db_sqlite.php b/codebase/db_sqlite.php
new file mode 100644
index 0000000..cd8de9d
--- /dev/null
+++ b/codebase/db_sqlite.php
@@ -0,0 +1,34 @@
+<?php
+/*
+ @author dhtmlx.com
+ @license GPL, see license.txt
+*/
+require_once("db_common.php");
+/*! SQLite implementation of DataWrapper
+**/
+class SQLiteDBDataWrapper extends DBDataWrapper{
+
+ public function query($sql){
+ LogMaster::log($sql);
+
+ $res = sqlite_query($this->connection,$sql);
+ if ($res === false)
+ throw new Exception("SQLLite - sql execution failed\n".sqlite_error_string(sqlite_last_error($this->connection)));
+
+ return $res;
+ }
+
+ public function get_next($res){
+ $data = sqlite_fetch_array($res, SQLITE_ASSOC);
+ return $data;
+ }
+
+ protected function get_new_id(){
+ return sqlite_last_insert_rowid($this->connection);
+ }
+
+ public function escape($data){
+ return sqlite_escape_string($data);
+ }
+}
+?> \ No newline at end of file