View Single Post
06-18-2012, 03:56 PM
#1
Dan is offline Dan
Dan's Avatar
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 3,164
iTrader: 15 / 86%
 

Dan is an unknown quantity at this point

  Old  Duplicate entries on a unique key?

Code:
ALTER TABLE  `users votes`,
ADD UNIQUE  `voting key` (  `userid` ,  `forumtopicid`  ,  `replyid`   )
http://i.imgur.com/PUzJY.png

Shouldn't the above prevent duplicate entries of userid, forumtopicid and replyid together?!?

If I seperate "voting key" into two uniques: userid & forumtopicd; userid & replyid. Then it works perfectly but I can't shake the feeling that it could and should be done on 1 unique key.

Reply With Quote