title: Can't update my database record in codeigniter, no error is appearing
body: <p>I'm quite new to php and there's no error appearing but appereantly, can't update my data in the database.</p>
  
  <p><a href="https://i.stack.imgur.com/drTLU.png" rel="nofollow noreferrer">The controller</a></p>
  
  <pre><code>  public function update_user_view() { 
       $this-&gt;load-&gt;helper('form'); 
       $user_id = $this-&gt;uri-&gt;segment('3'); 
       $query = $this-&gt;db-&gt;get_where("users",array("user_id"=&gt;$user_id));
       $data['records'] = $query-&gt;result(); 
       $data['old_user_id'] = $user_id; 
       $this-&gt;load-&gt;view('user_edit',$data); 
    } 
  
    public function update_user(){ 
       $this-&gt;load-&gt;model('user_model');
  
       $data = array(  
          'user_id' =&gt; $this-&gt;input-&gt;post('user_id'),
          'name' =&gt; $this-&gt;input-&gt;post('name'), 
          'nickname' =&gt; $this-&gt;input-&gt;post('nickname'), 
          'email' =&gt; $this-&gt;input-&gt;post('email'), 
          'hadd' =&gt; $this-&gt;input-&gt;post('hadd'), 
          'gender' =&gt; $this-&gt;input-&gt;post('gender'), 
          'cpnum' =&gt; $this-&gt;input-&gt;post('cpnum'), 
          'comment' =&gt; $this-&gt;input-&gt;post('comment') 
  
       ); 
  
       $old_user_id = $this-&gt;input-&gt;post('old_user_id'); 
       $this-&gt;user_model-&gt;update($data,$old_user_id); 
  
       $query = $this-&gt;db-&gt;get("users"); 
       $data['records'] = $query-&gt;result(); 
       $this-&gt;load-&gt;view('user_view',$data); 
    } 
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/AH3C1.png" rel="nofollow noreferrer">the model</a></p>
  
  <pre><code>&lt;?php 
     class User_model extends CI_Model {
  
        function __construct() { 
           parent::__construct(); 
        } 
  
        public function insert($data) { 
           if ($this-&gt;db-&gt;insert("users", $data)) { 
              return true; 
           } 
        } 
  
        public function delete($user_id) { 
           if ($this-&gt;db-&gt;delete("users", "user_id = ".$user_id)) { 
              return true; 
           } 
        } 
  
        public function update($data,$old_user_id) { 
           $this-&gt;db-&gt;set($data); 
           $this-&gt;db-&gt;where("user_id", $old_user_id); 
           $this-&gt;db-&gt;update("users", $data); 
        } 
     } 
  ?&gt; 
  </code></pre>