title: How to "reset" CodeIgniter active record for consecutive queries?
body: <p>I'm using CodeIgniter and have a case where two tables (projects and tasks) need to be updated with a value right after one another (active column needs to be set to "n"). The code I am using is:</p>
  
  <pre><code>function update($url, $id)
  {
      $this-&gt;db-&gt;where('url', $url);
      $this-&gt;db-&gt;update('projects', array('active' =&gt; 'n'));
      $this-&gt;db-&gt;where('eventid', $id);
      $this-&gt;db-&gt;update('tasks', array('active' =&gt; 'n'));
  }
  </code></pre>
  
  <p>With this code, the projects table gets updated but the tasks table does not. If I comment out <code>$this-&gt;db-&gt;update('projects', array('active' =&gt; 'n'));</code> then the tasks table gets updated.</p>
  
  <p>I reckon this has something to do with caching but I have tried <code>flush_cache</code> before the tasks <code>db-&gt;update</code> call but that didn't have any effect.</p>
  
  <p>Can someone explain how consecutive update queries can be executed using CodeIgniter?</p>