Welcome Guest, Not a member yet? Register   Sign In
$this->db->get_where
#1

Blush Hi, Good day.

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);
2) Model Function
Code:
$query = $this->db->get_where('userinfo', array('id' => $id, 'password' => $pw));
What I found:
a) When $pw is null
Supposed SQL should be:
Code:
select * from userinfo where id = '$id' and password is null;
But the actual SQL is like:
Code:
select * from userinfo where id = '$id';
Is this an issue or I made any mistake??
Thanks
Reply


Messages In This Thread
$this->db->get_where - by szhuge1 - 07-19-2016, 06:42 AM
RE: $this->db->get_where - by mwhitney - 07-19-2016, 09:45 AM
RE: $this->db->get_where - by Avenirer - 07-19-2016, 11:28 PM
RE: $this->db->get_where - by InsiteFX - 07-20-2016, 03:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB