PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, January 31, 2022

[FIXED] unique combination of 2 columns in phpmyadmin database

 January 31, 2022     mysql, phpmyadmin     No comments   

Issue

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 :

enter image description here

How do i proceed?


Solution

Since id is already primary key, you should choose "unique" Shown on screenshot below

enter image description here



Answered By - po_taka
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing