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
https://forums.phpfreaks.com/topic/67618-data-storage/
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
https://forums.phpfreaks.com/topic/67618-data-storage/#findComment-339730
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.