diff options
author | Kirylka <kirylanoshko@gmail.com> | 2015-03-31 17:56:47 +0300 |
---|---|---|
committer | Kirylka <kirylanoshko@gmail.com> | 2015-03-31 17:56:47 +0300 |
commit | f5f99c335707d9b11d40f1eb0f6ddb5a993fd31a (patch) | |
tree | d9c0d3532ec9f0f2fb68e31d2611282ae0642181 /codebase/db_sasql.php | |
parent | 458f0aead573842f1df00ce2ae00334c27f66585 (diff) | |
download | connector-php-f5f99c335707d9b11d40f1eb0f6ddb5a993fd31a.zip connector-php-f5f99c335707d9b11d40f1eb0f6ddb5a993fd31a.tar.gz connector-php-f5f99c335707d9b11d40f1eb0f6ddb5a993fd31a.tar.bz2 |
Creating a new connector for yii2.
Diffstat (limited to 'codebase/db_sasql.php')
-rw-r--r-- | codebase/db_sasql.php | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/codebase/db_sasql.php b/codebase/db_sasql.php deleted file mode 100644 index 025f5ef..0000000 --- a/codebase/db_sasql.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -require_once("db_common.php"); -/*! SaSQL implementation of DataWrapper -**/ -class SaSQLDBDataWrapper extends DBDataWrapper{ - private $last_id=""; //!< ID of previously inserted record - - public function query($sql){ - LogMaster::log($sql); - $res=sasql_query($this->connection, $sql); - if ($res===false) throw new Exception("SaSQL operation failed\n".sasql_error($this->connection)); - $this->last_result = $res; - return $res; - } - - public function get_next($res){ - if (!$res) - $res = $this->last_result; - - return sasql_fetch_assoc($res); - } - - public function get_new_id(){ - return sasql_insert_id($this->connection); - } - - protected function insert_query($data,$request){ - $sql = parent::insert_query($data,$request); - $this->insert_operation=true; - return $sql; - } - - protected function select_query($select,$from,$where,$sort,$start,$count){ - if (!$from) - return $select; - - $sql="SELECT " ; - if ($count) - $sql.=" TOP ".($count+$start); - $sql.=" ".$select." FROM ".$from; - if ($where) $sql.=" WHERE ".$where; - if ($sort) $sql.=" ORDER BY ".$sort; - return $sql; - } - - public function escape($data){ - return sasql_escape_string($this->connection, $data); - } - - public function begin_transaction(){ - $this->query("BEGIN TRAN"); - } -} -?>
\ No newline at end of file |