Quote:
Originally Posted by Toewalker
1) solution for the problem descriped earlier in my post #209:
add unique key over eventid AND userid in table eventattendance, for EXAMPLE (use at your own risk! maybe the prefix "vb3_" has to be adjusted):
Code:
ALTER TABLE `vb3_eventattendance` ADD PRIMARY KEY ( `eventid` , `userid` );
this way, the "REPLACE" SQL statement should work as expected (hardly tested!!).
|
That would not be a correct primary key. The installation script already created a unique index. Perhaps it should have been a composite key, but unique key should work. In anycase, the unique key or composite primary key needs to be on eventid, ocdate, and userid. Otherwise, when you have a ranged or recurring event, the REPLACE INTO will overwrite any other RSVPs for that user on other days of the event.
The installation script makes this statement:
PHP Code:
CREATE UNIQUE INDEX uq_eventattendance__eventuser ON ".TABLE_PREFIX."eventattendance (eventid,ocdate,userid);
That should do it. Did your installation not have a unique key called uq_eventattendance__eventuser, as the one above?