Jump to content

Data Storage


SJames

Recommended Posts

Hi, I'm writing a post/comment system. In it, users have the ability to either add or subtract 1 point from a comment's "score". I am trying to figure out the best way to do it.

 

I think my options are to either store what every user has done to every comment in a database, but this seems like it would get unmanageable very quickly.

 

My only other option that I can think of is to save what the user has done to a comment in a cookie, but this still seems like there would be massive amounts of cookies stored, and the user could make multiple changes to the comment's score by simply erasing the cookies and doing it again.

 

Are there any other ways of doing this sort of thing? If not, which option would you suggest, and would the best way of going about doing it?

Link to comment
Share on other sites

The way it's supposed to work is that each user can only add or subtract 1 point from the score. If all I had was a single score, than there would no way to regulate how many times each user modifies the score. I'm askig what the best way to regulate it is.

Link to comment
Share on other sites

The way it's supposed to work is that each user can only add or subtract 1 point from the score. If all I had was a single score, than there would no way to regulate how many times each user modifies the score. I'm askig what the best way to regulate it is.

Have a column in your post/comment table that holds the score, and one that lists the people who have already voted and can't vote again.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.