title: Update Query in codeigniter model is not working
body: <p>In the function update_status the 2nd update query is not working. The values in array are properly getting and correct. Can somebody please help me with that?</p>
  
  <p>Here my code:</p>
  
  <pre><code>    function update_status($appno,$value,$user_note,$date)
  {
      $status = array(
                  'app_status' =&gt; $value, );
      $this-&gt;db-&gt;where('app_no',$appno);
              $this-&gt;db-&gt;update('tbl_application', $status);          
  
      $today = date('Y-m-d');
      $emp = $this-&gt;session-&gt;userdata('username');
      $this-&gt;db-&gt;select('*');
      $this-&gt;db-&gt;from('tbl_employee');
      $this-&gt;db-&gt;where('Name', $emp); 
      $query = $this-&gt;db-&gt;get();
      foreach($query-&gt;result() as $row)
      {   $emp_code = $row-&gt;EmployeeCd;   }           
  
      $data = array(
                  'app_no' =&gt; $appno,
                  'office_code' =&gt; 'KL08',
                  'verifi_status' =&gt; $value,
                  'view_status' =&gt; 1,
                  'view_by' =&gt; $emp_code,
                  'first_view' =&gt; $date,
                  'last_view' =&gt; $today,
                  'modification' =&gt; $user_note,
                  'modifi_status' =&gt; '1',
                  'notes' =&gt; 'NA'
                      );
      $this-&gt;db-&gt;update('tbl_appverification', $data);        
      $this-&gt;db-&gt;where('app_no',$appno);
  
  }
  </code></pre>