ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:hasfailedtrans

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
reference:hasfailedtrans [2015/08/07 04:49] – created mnewnhamv5:reference:connection:hasfailedtrans [2016/03/19 03:23] (current) mnewnham
Line 2: Line 2:
 ~~NOTOC~~ ~~NOTOC~~
 <WRAP right box> <WRAP right box>
 +== See Also ==
 +[[v5:userguide:transactions|Managing Transactions With ADOdb]]
 == Syntax == == Syntax ==
   bool hasFailedTrans()   bool hasFailedTrans()
 </WRAP> </WRAP>
 ===== Description ===== ===== Description =====
-The function ''hasFailedTrans()'' reports if a granular transaction has failed.+The function ''hasFailedTrans()'' reports if a smart transaction has failed, or if the [[v5:reference:connection:failtrans|failTrans()]] method has been called. The method must be called before [[v5:reference:connection:completetrans|completeTrans()]], otherwise it will not report correctly. 
 ===== Usage ===== ===== Usage =====
 <code php> <code php>
-$db->beginTrans()+$db->startTrans()
 /* /*
  * Table updates, correct?  * Table updates, correct?
  */  */
 if ($db->hasFailedTrans()) if ($db->hasFailedTrans())
 +{
     /*     /*
      * Do something      * Do something
-     * /+     */ 
 +
 +$db->completeTrans();
 </code> </code>
 +{{tag>["Smart Transactions"]}}
v5/reference/connection/hasfailedtrans.1438915781.txt.gz · Last modified: 2017/04/21 11:34 (external edit)