Jump to content

Hold voting information


The Little Guy

Recommended Posts

My site will have images, games, videos. I am adding a voting system to each.

 

Now each user can only vote one time per image/game/video, but he/she can change their vote after 24 hrs from their last vote on that particular item.

 

So, to my question:

Would you place the voting information in multiple tables, all have the same value, just one table for images, one for games, and one for video.

OR

Would you place them all in one table, and have an extra column telling what this is a vote for (image, game, video)

OR

Would you do something else?

Link to comment
Share on other sites

Haha, this brings back some memories! I started by saving votes (and comments, etc) all in separate tables... bad idea.

 

Save them in 1 table and simply differentiate them using an enumeration.

 

Then simply write a class to handle the votes system. Save a timestamp with each vote so votes can be removed after 24 hours ;-)

 

I'm actually upgrading my voting system to "reviews" :-)

 

Kind regards,

Scott

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.