[eluser]slacker2[/eluser]
I made the change to $this->db->escape(dohash($pw)). After testing, the hashes are the same. I was still having a problem with the query finding a match due to the quotes around it. I manually edited the database and put quotes around the username and password and it worked. Is this a normal and expected behavior of the escape function? In the end it will be ok if it is, because I will be escaping the input when I add the user to the database. I am just wondering since this could potentially cause some other problems.
Here is the query in my function:
Quote:$this->db->select('id,username');
$this->db->where('username', $this->db->escape($u);
$this->db->where('password', $this->db->escape(dohash($pw));
$this->db->where('active', 1);
$this->db->limit(1);
$Q = $this->db->get('users');
The output for $u is username while the output for $this->db->escape($u) is 'username'. Is there something else I should be doing?
Thanks.