07-19-2016, 06:42 AM

I found this thing by mistake.
1) Controller Function
Code:
$id = trim($this->input->post('id'));
$pw = md5(trim($this->input->post('pwd')));
$queryResult = $this->userinfo_model->login_user($id, $pw);
Code:
$query = $this->db->get_where('userinfo', array('id' => $id, 'password' => $pw));
a) When $pw is null
Supposed SQL should be:
Code:
select * from userinfo where id = '$id' and password is null;
Code:
select * from userinfo where id = '$id';
Thanks