====== hasFailedTrans ====== ~~NOTOC~~ == See Also == [[v5:userguide:transactions|Managing Transactions With ADOdb]] == Syntax == bool hasFailedTrans() ===== Description ===== 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 ===== $db->startTrans() /* * Table updates, correct? */ if ($db->hasFailedTrans()) { /* * Do something */ } $db->completeTrans(); {{tag>["Smart Transactions"]}}