title: CodeIgniter Active Record method chaining with update not working
body: <p>I'm trying to use Active Record methods to update a table and flag a task as complete like this:</p>
  
  <pre><code>$this-&gt;db-&gt;update('tasks', array('status' =&gt; 'complete'))
             -&gt;where('id', $task_id);
  </code></pre>
  
  <p>But it's giving me an error:</p>
  
  <pre><code>Call to a member function where() on a non-object
  </code></pre>
  
  <p>Is there something wrong here that I can't see here? or does method chaining not work with update? The docs are pretty thin on method chaining..</p>
  
  <p>It does work if I break it into two lines...</p>
  
  <pre><code>$this-&gt;db-&gt;where('id', $task_id);
  $this-&gt;db-&gt;update('tasks', array('status' =&gt; 'complete'));
  </code></pre>
  
  <p>but shouldn't method chaining work here?</p>
  
  <p>PHP version: 5.5.4
  CI version: 3</p>