⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠


profile picture

Two field as one unique field in Grocery Crud


  • profile picture
  • Member

Posted 19 March 2013 - 13:40 PM

I have one problem in GroceryCrud.

I want to insert the data in one table. Table is like this:

id, card_no, site_code, site_no

card_no is unique and i have implemented it.

However; my problem is that site_code and site_no should be unique only is both values match. Which means that is site_code is 101 and site_no is 102 and we try to insert identical values for both again is should reject it. If we one of the values is different it should allow it. In this case we are treating both values as one when we insert it.

I hope I'am clear.

Thanks in advance.