The function hasFailedTrans()
reports if a smart transaction has failed, or if the failTrans() method has been called. The method must be called before completeTrans(), otherwise it will not report correctly.
$db->startTrans() /* * Table updates, correct? */ if ($db->hasFailedTrans()) { /* * Do something */ } $db->completeTrans();