Changeset:
        5e3b6206f739
        
https://sourceforge.net/p/mrbs/hg-code/ci/5e3b6206f739377b9b80b2d089f6a0e549276eb9
Author:
        Campbell Morrison <[email protected]>
Date:
        Tue Sep 27 15:56:18 2016 +0100
Log message:

Added rollback to transaction

diffstat:

 web/del.php |  23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diffs (34 lines):

diff -r 0a52b0f5370b -r 5e3b6206f739 web/del.php
--- a/web/del.php       Tue Sep 27 15:09:05 2016 +0100
+++ b/web/del.php       Tue Sep 27 15:56:18 2016 +0100
@@ -24,12 +24,25 @@
     // They have confirmed it already, so go blast!
     sql_begin();
     // First take out all appointments for this room
-    sql_command("delete from $tbl_entry where room_id=$room");
-    sql_command("delete from $tbl_repeat where room_id=$room");
+    $result = sql_command("delete from $tbl_entry where room_id=$room");
+    if ($result >= 0)
+    {
+      $result = sql_command("delete from $tbl_repeat where room_id=$room");
+      // Now take out the room itself
+      if ($result >= 0)
+      {
+        sql_command("delete from $tbl_room where id=$room");
+      }
+    }
    
-    // Now take out the room itself
-    sql_command("delete from $tbl_room where id=$room");
-    sql_commit();
+    if ($result >= 0)
+    {
+      sql_commit();
+    }
+    else
+    {
+      sql_rollback();
+    }
    
     // Go back to the admin page
     Header("Location: admin.php?area=$area");

------------------------------------------------------------------------------
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to