i am trying to change password in database but it's not working..it printing the password correctly..but it's not save in the database..

Here is my controller:

public function resetpwd($user\_id=NULL)
{ 

```
  //echo $user_id;
$this->load->helper('form');
$data['msg']=array();
if($this->input->post())
  {
   $user_id= $this->input->post('user_id');
  //echo $id; 
   $this->LoginModel->resetpwd($this->input->post(),$user_id);
//redirect(base_url('resetpwd/'.$id));
  }
  $this->load->view('Admin/resetpwd',$data);

```

}

Here is my Model:

```
    function resetpwd($post='',$user_id) 
{

    $data=array('password'=>$post['password']);
    $this->db->where('user_id', $user_id);
    $this->db->update('users', $data);
    return true;
    print_r($data);

}

```

Please help me how to do this

Thank you