I have been trying to do the update the record in my database but i am getting the echo that the action have not being updated all i want is to update balance field in the database! The following is the code in the controller where i take value that i have passed from ajax and i am passing the email and data to model. Controller.
public function transfer_amount(){
$email = $this->input->post('view');
$data = array(
'balance' => $this->input->post('amount'),
);
$this->load->model('user_model');
if($this->user_model->transfer_amount($data,$email)){
echo'unsuccessfull';
}
else
{
$this->load->view('layer_service/success',$data);
}
}
The Model which is supposed to update the field of the database is as following.
function transfer_amount($data,$email){
$this->db->where('email', $email);
$this->db->update('tbl_users', $data);
// Code here after successful insert
// to the controller
return true;
}