Reputation: 959
I have a table with 3 columns : id, person and code.
I want that the combination of person
and code
to be unique in the table, wich means that the same person with the same code is not allowed more than one time in the table.
How can I set such thing in phpmyadmin?
Thanks for help and excuse my english.
EDIT
I have the 2 columns selected in my screen :
How do i proceed?
Upvotes: 11
Views: 6113
Reputation: 658
You should select both fields and choose unique key.you can find this key at bottom field near primary key.
Upvotes: 1
Reputation: 1856
Since id is already primary key, you should choose "unique" Shown on screenshot below
Upvotes: 16
Reputation: 3311
Click in table name so to have the fields view.
Select the two fields you need.
Click on key at the bottom of fields.
Upvotes: 1