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?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.