title: Why does CI create a new row instead of updating?
body: <p>I'm creating a UI in my application which will allow the user to decide the state of received content, this includes updating it. How does CI handle this?</p>
  
  <p>I've tried the different update methods provided in the query builder part of the documentation, including <code>replace</code> and <code>update</code>, I pass on the data from the view to the controller, to the model in the form of an array. Yet still, when I try it, it creates a new row with that single value and with all other columns empty.</p>
  
  <blockquote>
    <p>view.php</p>
  </blockquote>
  
  <pre><code>&lt;form action="Application/Update" method="get"&gt;
  &lt;input type="hidden" name="mar-id" value="&lt;?php echo $row['id']; ?&gt;"&gt;
  &lt;input type="hidden" name="mar-read" value="New-value"&gt;
  &lt;?php echo anchor('http://localhost/dir/dir/dir/index.php/Application/Update', 'update'); ?&gt;
  &lt;/form&gt;
  </code></pre>
  
  <blockquote>
    <p>controller.php</p>
  </blockquote>
  
  <pre><code>public function Update() {
  
    $this-&gt;load-&gt;helper('url');
    $this-&gt;load-&gt;model('Main');
  
    $id = $this-&gt;input-&gt;post('mar-id');
    $value = $this-&gt;input-&gt;post('mar-read');
  
    $mar = $this-&gt;Main-&gt;Update($id, $value);
  
    if ($mar == TRUE) {
      redirect('http://localhost/dir/dir/dir/index.php/Application/Otherpage', 'refresh');
    }
    else {
      redirect('http://localhost/dir/dir/dir/index.php/Application/Otherpage');
    }
  }
  </code></pre>
  
  <blockquote>
    <p>model.php</p>
  </blockquote>
  
  <pre><code>public function Update($id, $value) {
  
    $data = array(
      'status' =&gt; $value
    );
    $this-&gt;db-&gt;where('id', $id);
    $update = $this-&gt;db-&gt;update('table', $data);
  
  }
  </code></pre>
  
  <p>As I said, I expect the row to be updated based on the row-id provided. Instead it creates a completely new row with that single value. It doesn't return any error messages though.</p>