Revision: 1798
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1798&view=rev
Author:   cimorrison
Date:     2011-03-01 09:11:18 +0000 (Tue, 01 Mar 2011)

Log Message:
-----------
Improved error reporting in previous change

Modified Paths:
--------------
    mrbs/trunk/web/upgrade/17/post.inc

Modified: mrbs/trunk/web/upgrade/17/post.inc
===================================================================
--- mrbs/trunk/web/upgrade/17/post.inc  2011-03-01 08:45:29 UTC (rev 1797)
+++ mrbs/trunk/web/upgrade/17/post.inc  2011-03-01 09:11:18 UTC (rev 1798)
@@ -84,9 +84,16 @@
   $sql = "UPDATE $tbl_repeat
              SET status=status|" . STATUS_AWAITING_APPROVAL . "
            WHERE id=" . $row['repeat_id'];
-  if (sql_command($sql) != 1)
+  $result = sql_command($sql);
+  if ($result == -1)
   {
+    // We've got an SQL error, so report it
     trigger_error(sql_error(), E_USER_WARNING);
+  }
+  if ($result != 1)
+  {
+    // Something's gone wrong.   There's either been an SQL error, or else no 
rows have been
+    // affected, which should not be the case
     fatal_error(FALSE, "Failed to update status column in repeat table with 
approval status.");
   }
 }  


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to