Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14343

$this->db->get_where

$
0
0
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

Viewing all articles
Browse latest Browse all 14343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>