php - Duplicate records are allowed in table with two primary keys -



php - Duplicate records are allowed in table with two primary keys -

i have table "userdetails" in 2 columns namely "emailid" , "userid" set primary key. don't key violation sql engine when seek insert duplicate values in table. how debug this?

screenshots :

you don't have 2 primary keys, have composite primary key 2 columns considered primary key.

this means both columns together must unique. current screenshot shows while 2 records have same email, respective rows have different userid's, primary (composite) key unique between two, because both emailid , userid not same between 2 records.

read more composite keys here

edit: i'm not exclusively you're trying accomplish, guess want userid primary key, , have emailid unique field.

php mysql sql

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

ubuntu - Bash Script to Check That Files Are Being Created -