I've got this site that I've been working on that functions very similar to Digg/Reddit. Users submit headlines and the rest of the community either upvotes or downvotes them.

Right now I'm just setting a cookie every time a user votes on a story, but this only lasts for awhile, and users can always clean out their cookies and vote multiple times.

What I'd like to know is whether or not there's a way to keep track of each vote individually with a mysql database. There are hundreds of headlines cycling through the site constantly, so I can't just set up a new table for each one to hold the votes. Maybe I can store the users who have voted in some sort of an array on the database or something?

9 Years
Discussion Span
Last Post by pritaeas

You could create a table that contains a users id and a headline's id. If the record is in there, he already voted. Both fields can function as a single unique primary key, so speed should not be an issue.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.