0

I have a user editing table in my admin page in my website. I want to check if theres a duplication with the username and the email when i update a row. Every row prefers to a different user and has her own id. I want that if in a certain row there a username and email values they cant be duplicated (every id has its own stats). How can i check the duplication ? (I work with myadohelper) Hope to a quick answer, thanks

1 Answer 1

2

The best way to do this is by setting up a unique constraint/index in the database.

alter table t add constraint unq_t_username_email on t(username, email); 

An attempt to add a row that already exists will result in an error.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.