Jump to content

unique value based on another column?


jairathnem

Recommended Posts

Hello,

 

My scenario is I need to have a unique value in a column based on value from another column.

 

for ex : I have item_ID and product column

 

For every item_ID there should only be unique values in the product column.

 

item_ID    Product

1               1

1               2

1               4

2               1

 

 

but if I insert 1 in item_ID and 1 in product now, it should throw an error.

I have no idea how to implement this. Any help appreciated.

Link to comment
https://forums.phpfreaks.com/topic/286255-unique-value-based-on-another-column/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.