galdikas Posted March 30, 2011 Posted March 30, 2011 Ok.. So I want to make usernames case senisitive. Just to prevent people from selecting similar username, and the imposing as someone else... Currently only way to choose username is during registration.. I think relevant code is following: if ($passed_verification==1) { require('jungtis.php'); $db_username=mysql_query("SELECT * FROM users WHERE username='$uname'"); $db_uname_check=mysql_num_rows($db_username); if ($db_uname_check==1) { $taken_username="Username $uname is already taken. Please choose a different username!"; } So if query returns any rows.. It will say that username is taken. So if we say that my username is Vytas. and someone decided to register as vytas or VYTAS or VYtas etc etc..., that query will not return any rows, and user will be allowed to register. So what should i do? Regex? or maybe something to do with strpos??? Quote
Dayo Posted March 30, 2011 Posted March 30, 2011 http://aspadvice.com/blogs/ssmith/archive/2007/09/30/Case-Sensitive-or-Insensitive-SQL-Query.aspx Quick google Quote
galdikas Posted March 30, 2011 Author Posted March 30, 2011 Thanks :) I would of googled it myself... But wasn't even sure what to look for lol Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.