openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 4fea43ada0b29aa3252c95963382b0b04ce86420
parent 5430293bd77bad5ae2e94b2ab3b2f635e564bbf8
Author: dankert <devnull@localhost>
Date:   Thu, 15 Oct 2009 02:00:37 +0200

Erweiterungen für Prepared-Statements.

Diffstat:
db/sqlite3.class.php | 49+++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+), 0 deletions(-)

diff --git a/db/sqlite3.class.php b/db/sqlite3.class.php @@ -105,6 +105,55 @@ class DB_sqlite3 { return $this->result->numRows(); } + + + + /** + * Startet eine Transaktion. + */ + function start() + { + $this->connection->query( 'BEGIN TRANSACTION;'); + } + + + /** + * Beendet eine Transaktion. + */ + function commit() + { + $this->connection->query( 'COMMIT;'); + } + + + /** + * Bricht eine Transaktion ab. + */ + function rollback() + { + $this->connection->query( 'ROLLBACK;'); + } + + + function prepare( $query,$param) + { + foreach( $param as $pos) + { + foreach( $pos as $pos ) + { + $query = substr($query,0,$pos-1).'?'.substr($query,$pos+1); + } + } + + $this->stmt = sqlite3_prepare($this->connection,$query); + + } + + function bind( $param,$value ) + { + $this->params[$param] = $value; + } + } ?> \ No newline at end of file