how to avoid duplication of data if the name already exists in the database ?


I’ve a database with member names and data and I would like to know how can I avoid to duplicate data if the user name already exist in the database ?
So in another words I would like to update two datas when the user already exist.


See this example:

Prevent Database Duplicates
Prevent duplicates from entering a database collection.