title: Update query is not working in codiegniter
body: <p>I am trying to update the records of stud table using codeigniter, but it did not updating the record, please see the following code of <strong>Stud_edit.php</strong> file :</p>
  
  <pre><code>&lt;!DOCTYPE html&gt; 
  &lt;html lang = "en"&gt;
  &lt;head&gt; 
    &lt;meta charset = "utf-8"&gt; 
    &lt;title&gt;Students Example&lt;/title&gt; 
  &lt;/head&gt; 
  &lt;body&gt; 
  &lt;form method = "" action = ""&gt;
   &lt;?php 
          echo form_open('Stud_controller/update_student'); 
          echo form_hidden('old_roll_no',$old_roll_no); 
          echo form_label('Roll No.'); 
          echo form_input(array('id'=&gt;'roll_no',
             'name'=&gt;'roll_no','value'=&gt;$records[0]-&gt;roll_no)); 
          echo "
          "; 
  
          echo form_label('Name'); 
          echo form_input(array('id'=&gt;'name','name'=&gt;'name',
             'value'=&gt;$records[0]-&gt;name)); 
          echo "
          "; 
  
          echo form_submit(array('id'=&gt;'sub mit','value'=&gt;'Edit')); 
          echo form_close();
       ?&gt; 
  
    &lt;/form&gt; 
  </code></pre>
  
  <p></p>
  
  <p>
  Following is code of controller :</p>
  
  <pre><code>public function update_student(){ 
       $this-&gt;load-&gt;model('Stud_Model');
  
       $data = array( 
          'roll_no' =&gt; $this-&gt;input-&gt;post('roll_no'), 
          'name' =&gt; $this-&gt;input-&gt;post('name') 
       ); 
  
       $old_roll_no = $this-&gt;input-&gt;post('old_roll_no'); 
       $this-&gt;Stud_Model-&gt;update($data,$old_roll_no); 
  
       $query = $this-&gt;db-&gt;get("stud"); 
       $data['records'] = $query-&gt;result(); 
       $this-&gt;load-&gt;view('Stud_view',$data); 
    }
  </code></pre>
  
  <p>And following is code of model  :</p>
  
  <pre><code>public function update($data,$old_roll_no) { 
       $this-&gt;db-&gt;set($data); 
       $this-&gt;db-&gt;where("roll_no", $old_roll_no); 
       $this-&gt;db-&gt;update("stud", $data); 
    } 
  </code></pre>