title: CodeIgniter : Transaction ERROR vs MySQL ERROR
body: <p>How can I tell if the transaction was FALSE or if something else happened(locked table)?</p>
  
  <pre><code>    $this-&gt;db-&gt;trans_start();
  
      $this-&gt;db-&gt;where('id', $id)
               -&gt;limit(1);
  
      $q = $this-&gt;db-&gt;delete('table');
  
      $this-&gt;db-&gt;trans_complete();
  
      return $this-&gt;db-&gt;trans_status() ? TRUE : FALSE;
  </code></pre>
  
  <p>For example, the transaction might fail because of a foreign key constraint. If that is the case I would run another query. In any other case I want to retry the original query.</p>