From 9b4f4f8eb492c6c3f1105b7dbee5d4f36ac4b114 Mon Sep 17 00:00:00 2001
From: Robert Anderson <randerson@lbsd.net>
Date: Tue, 12 May 2009 13:50:29 +0000
Subject: [PATCH] Added db begin, commit and rollback transaction functions

---
 webgui/include/db.php | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/webgui/include/db.php b/webgui/include/db.php
index 693ed819..987a6f45 100644
--- a/webgui/include/db.php
+++ b/webgui/include/db.php
@@ -408,6 +408,40 @@ function DBLastInsertID()
 }
 
 
+# Function to begin a transaction
+# Args: none
+function DBBegin()
+{
+	global $db;
+
+	$res = $db->beginTransaction();
+
+	return $res;
+}
+
+
+# Function to commit a transaction
+# Args: none
+function DBCommit()
+{
+	global $db;
+
+	$res = $db->commit();
+
+	return $res;
+}
+
+
+# Function to rollback a transaction
+# Args: none
+function DBRollback()
+{
+	global $db;
+
+	$res = $db->rollback();
+
+	return $res;
+}
 
 # Connet to database when we load this file
 $db = connect_db();
-- 
GitLab