Friday, 15 June 2012

database - Prevent Duplicate Inserts SQL in PhpMyadmin -


I have a table called user whose structure looks like this:

user_id and in the Both google_id must be checked for duplicate data when we take these two columns one by one, I should be able to insert data from a problem. I mean that in a record, one of the user_id or google_id can already have the same value in the table. But not in both, I tried many things, yet it could not work. Can anyone guide me? I create a unique index on two columns: using phpmyadmin

"post-text" itemprop = "text">

/ P> user_id and google_id, create unique index users_ids for user (user_id, google_id)

, the unique index will cause an error.


No comments:

Post a Comment