-<<<<<<< HEAD:include/dba.php
-
- /**
- * starts a transaction. Transactions need to be finished with
- * commit() or rollback(). Please mind that the db table engine may
- * not support this.
- */
- public function beginTransaction() {
- if($this->mysqli) {
- return $this->db->autocommit(false);
- } else {
- //no transaction support in mysql module...
- mysql_query('SET AUTOCOMMIT = 0;', $db);
- }
- }
-
- /**
- * rollback a transaction. So, rollback anything that was done since the last call
- * to beginTransaction().
- */
- public function rollback() {
- if($this->mysqli) {
- return $this->db->rollback();
- } else {
- //no transaction support in mysql module...
- mysql_query('ROLLBACK;', $db);
- }
- $this->stopTransaction();
- }
-
- /**
- * commit a transaction. So, write any query to the database.
- */
- public function commit() {
- if($this->mysqli) {
- return $this->db->commit();
- } else {
- //no transaction support in mysql module...
- mysql_query('COMMIT;', $db);
- }
- $this->stopTransaction();
- }
-
- private function stopTransaction() {
- if($this->mysqli) {
- return $this->db->autocommit(true);
- } else {
- //no transaction support in mysql module...
- mysql_query('SET AUTOCOMMIT = 1;', $db);
- }
- }
-
- public function dbg($dbg) {
- $this->debug = $dbg;
- }
-=======