I have a registration form in place that I validate for duplicate username before allowing a db insert. I just realized however, that if I try to SELECT 'Bobby' and the db contains a username BoBbY, it won't return a result.
I know I could just strtolower() or ucfirst() all the inserts and selects, but I'd rather let the user keep the case they want in their username. I've been messing around with this for a while now, but I need some help figuring this one out. How can I query the db so the WHERE field = 'username' will match the record 'UserName', 'UsErNaMe', etc.?
It should go without saying I'd prefer to avoid a SELECT * FROM table, and then looping through every record with a while($array) / if(strtolower($input) == strtolower($record).