summaryrefslogtreecommitdiffstats
path: root/codebase/connector/db_sqlite3.php
blob: 349490b6408895ca7aa24ee37736a4acad8591e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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();
	}
	
	public function get_new_id(){
		return $this->connection->lastInsertRowID();
	}
	
	public function escape($data){
		return $this->connection->escapeString($data);
	}		
}
?>