diff usrajax.php @ 580:3929a5a87815

Use the new transaction functions here as well.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 02 Oct 2014 13:37:15 +0300
parents ce11ea112a65
children bf33cec02dc6
line wrap: on
line diff
--- a/usrajax.php	Thu Oct 02 13:36:59 2014 +0300
+++ b/usrajax.php	Thu Oct 02 13:37:15 2014 +0300
@@ -83,7 +83,7 @@
         array(CHK_RANGE, VT_INT, array($voteMin, $voteMax), "Invalid vote value.")))
     {
       // Check if the entry_id is actually valid
-      stExecSQL("BEGIN TRANSACTION");
+      stDBBeginTransaction();
       $sql = stPrepareSQL("SELECT * FROM entries WHERE id=%d", $entry_id);
       if (($entry = stFetchSQL($sql)) !== false)
       {
@@ -94,7 +94,7 @@
           stUpdateVote($voteKeyId, $entry_id, $vote);
         }
       }
-      stExecSQL("COMMIT");
+      stDBCommitTransaction();
     }
     break;
 
@@ -103,7 +103,7 @@
       stError("Voting is not enabled.");
     else
     {
-      stExecSQL("BEGIN TRANSACTION");
+      stDBBeginTransaction();
       foreach (stExecSQL("SELECT * FROM compos WHERE visible<>0 AND voting<>0") as $compo)
       {
         $cid = $compo["id"];
@@ -117,7 +117,7 @@
           }
         }
       }
-      stExecSQL("COMMIT");
+      stDBCommitTransaction();
 
       if ($errorSet)
       {