Jump to content


is_unique for two or more fields

is_unique unique

  • Please log in to reply
1 reply to this topic

#1 manfredrunkel

manfredrunkel

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 13 February 2013 - 11:51 AM

Hi!

 

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 
 
is_unique[mytable.month]|is_unique[mytable.year]
 
but didn't work.
 
Thank you


#2 victor

victor

    grocery CRUD Hero

  • Advanced Member
  • PipPipPip
  • 967 posts
  • LocationMinsk

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