$data['users'] = array(
'email' => $this->input->post('email'),
'password' => $this->input->post('password')
);
users배열에 form에서 넘어온 이메일,패스워드값을 넣고
$this->Login_model->check_users($data);
로그인 모델 페이지로 전달을 하였는데 받는쪽에서 계속 에러가 납니다..
public function check_users($data) {
$this->db->where('email', $data->email);
$this->db->where('password', $data->password);
return $this->db->count_all_results($this->table);
}
혹시 $data['users'] 이런식으로 해서 넣은 값을 모델에서 받을때 어떤식으로 받아야되는지 조언 부탁드립니다~~~
보내주는 $data는 배열 형태인데, 사용하는 $data는 객체 형식이라 없는 데이터를 불러와서 에러가 발생하시는 것 같습니다.
check_users 메소드 $data 부분을 이렇게 변경해보시기 바랍니다.
public function check_users($data) {
$this->db->where('email', $data['users']['email']);
$this->db->where('password', $data['users']['password']);
return $this->db->count_all_results($this->table);
}