chibineku Posted October 15, 2009 Share Posted October 15, 2009 I want to allow users to register with their username/email address in any combination of upper and lower case characters they like, but to check at registration, login and account management instances that no e-mail address with the same username/email address exists irrespective of case. I am aware that I can use LOWER() in mysql queries, but if I tried, for example:"SELECT id FROM aromaMaster WHERE email = '".strtolower($email)."'";that would only work if I did strtolower on insertion, right? Can I make the WHERE email clause case insensitive? Link to comment Share on other sites More sharing options...
justsomeguy Posted October 15, 2009 Share Posted October 15, 2009 "SELECT id FROM aromaMaster WHERE LOWER(email) = '".strtolower($email)."'"; Link to comment Share on other sites More sharing options...
chibineku Posted October 15, 2009 Author Share Posted October 15, 2009 That was what I thought, but I just figured that would never work - it's never that easy. I am really impressed overall with the thought that the developers of MySQL put into it - there is a simple way of doing everything. Just consider the simple logic of ON DUPLICATE KEY UPDATE for an example. Link to comment Share on other sites More sharing options...
justsomeguy Posted October 15, 2009 Share Posted October 15, 2009 Right. Most of that isn't specific to MySQL, it's part of the official SQL spec. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.