In my website usernames are saved like this robert and funny thing is that one can registers with the name Robert (Capital R).
How would I prevent these somehow duplicated usernames?
My project is in mysql/php
if (mysql_num_rows(mysql_query("SELECT username FROM user_table WHERE username='$username'")) > 0){
die("duplicated usernames can't be saved , this username exists.");
}
Even with this code Robert can be registered.
Convert them both to the same case and then compare them.
As such:
SELECT username FROM table WHERE LOWER(username) = LOWER('$username')