[eluser]Elliot Haughin[/eluser]
Case insensitivity is a good idea...
But instead of doing:
Code:
"LOWER(username)` = '".strtolower($attempt->username)."'")
Just do:
Code:
$this->db->where('username', strtolower($username));
Then make your 'insert' convert the username into lowercase before it goes into the db.
That way, you know that all usernames in the DB are lowercase and you dont have to run LOWER() on every select request.