3
In a Mysql database table, I have new user registration, and the primary key of the table is an ID field. However, I may end up creating, even by accident, users with the same username.
For example, "Joao.silva" can be registered to users named "João Carlos da Silva" and "João Silva Neto". Only then the login will only work for one of them.
Is there any configuration that can be done in Mysql so that this table does not allow identical usernames?
Yes, make that column one
unique key
– rray
Well, the correct thing would be to perform a select at the time of registration, checking if a name is the same as trying to register, if there is no normal registration, otherwise displays message that user already exists!
– Juliano Morche
@rray Know how I can do this via Adminer or through some SQL statement?
– Gustavo Hoppe Levin
http://stackoverflow.com/q/15255304/4190610
– Jéf Bueno