⚠ In case you've missed it we are migrating 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 forum is read-only and soon will be archived. ⚠

is_unique for two or more fields

is_unique unique

  • Please log in to reply
1 reply to this topic

#1 manfredrunkel



  • Members
  • Pip
  • 4 posts

Posted 13 February 2013 - 11:51 AM



I would like to know if there are some way to add the unique rule for two or more fields,


for example,


i have this unique index



ALTER TABLE `mytable` 
ADD UNIQUE INDEX `uq` (`year` ASC, `month` ASC, `idclass` ASC)
i would like to prevent the user (and show a message) that he is not able to insert the value due the unique validation.
I've tried 
but didn't work.
Thank you

#2 victor


    grocery CRUD Hero

  • Advanced Member
  • PipPipPip
  • 967 posts

Posted 14 February 2013 - 06:05 AM

there's some posts about is_unique problem. try use search.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users