Just want to return a variable from model to controller and then check if it's value is 0 or 1 but it does not work. I use Codeigniter. Could you please check my code and help me to find my mistake.
Here is my model:
public function did_get_status($id){
$this->db->select('*');
$this->db->from('members');
$this->db->where('id',$id);
$query = $this->db->get();
if ($query->num_rows() == 1) {
$row = $query->row();
return array(
'member_status' => $row->member_status,
);
}
else{
return false;
}
}
Here is my controller:
$status_info = $this->model_users->did_get_status($id);
$status = $status_info['member_status'];
if ($status === 0) {
//
}
else if ($status === 1) {
//
}
}