corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » change it so we can only vote once?

Poll: change it so we can only vote once?
  yes
  no


New Topic

New Poll
  <<  1    2  >> Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author change it so we can only vote once?
ed
Member

Registered: 10th Sep 03
User status: Offline
16th Dec 09 at 12:39   View User's Profile U2U Member Reply With Quote

Extra table that stores the id of the user voting and the id of the poll. When you vote you get added to the table and if you try to vote again then a script will check the table and prevent your vote from being cast. It would be backwards compatible with previous polls, but it would allow you to vote one more time on polls where you have already made a vote. Boom.
ed
Member

Registered: 10th Sep 03
User status: Offline
16th Dec 09 at 12:42   View User's Profile U2U Member Reply With Quote

If you're worried about filling the DB up with useless data, you could set it so that polls have a lifetime. When they have exceeded their life a CRON job will close the poll and delete all the records regarding that poll, only keeping the results.
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
16th Dec 09 at 13:58   View Garage View User's Profile U2U Member Reply With Quote

quote:
Originally posted by Cosmo
Does it matter about the old polls?
Not really but if I was converting the last few months worth I may as well do them all. Its converting them that doubled the size of the job.
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
16th Dec 09 at 13:59   View Garage View User's Profile U2U Member Reply With Quote

quote:
Originally posted by ed
Extra table that stores the id of the user voting and the id of the poll. When you vote you get added to the table and if you try to vote again then a script will check the table and prevent your vote from being cast.
Yes, this is the solution.

  <<  1    2  >>
New Topic

New Poll

Corsa Sport » Message Board » Off Day » change it so we can only vote once? 23 database queries in 0.3383210 seconds