deep bhatiya
deep bhatiya

Reputation: 11

how i can prevent same entry at same time?

I have a tripexpense system.

The situation is: two or more users register at the same time with same record and both are success.

Whereas one of them should get a success and the rest should get an error.

Upvotes: 0

Views: 70

Answers (1)

Rahul
Rahul

Reputation: 18577

You can do in this way,

ALTER TABLE Users ADD UNIQUE (email_id);

So in this way for same user with email id wont create two entries.
You can apply unique constraint to relevant field if its not email_id.

Upvotes: 3

Related Questions