title: Codeigniter $this->db->affected_rows() always returns 1
body: <p>I'm using codeigniter version 2.0.3. I'm trying get the number of affected rows after an update query using </p>
  
  <pre><code>$this-&gt;db-&gt;affected_rows
  </code></pre>
  
  <p>It always returns 1 even if no row had been updated. I tried with </p>
  
  <pre><code>mysql_affected_rows()
  </code></pre>
  
  <p>and it returns -1 for a query failure and 0 if no record had been updated .</p>
  
  <p>Edit included my code </p>
  
  <p>I'm just using </p>
  
  <pre><code>$country_id = $this-&gt;input-&gt;post('country_id');
  $time=$this-&gt;input-&gt;post('time');
  
  $insert_array = array(
    'country' =&gt; $this-&gt;input-&gt;post('name')
  );
  $this-&gt;db-&gt;update('country_master', $insert_array, array("country_id" =&gt; $country_id,"last_updated"=&gt;$time));
  $afftectedRows=$this-&gt;db-&gt;affected_rows();
  </code></pre>