Jump to content

Remember user options/selection


Paradoxz

Recommended Posts

I am working on a site that is going to have hundreds of polls that people can vote on. Once any user creates a new poll (vote: Hayden Panettiere vs. Kristen Bell as an example) I want to have the database remember what member voted on what, for each poll. So user 1 voted Hayden, user 327 voted Kristen.. etc.. I expect up to 500 users to vote on each topic, but a new column to store each username that voted seems insane. I was thinking arrays, but am not sure if that would work. I don't think that a new table per poll would be very efficient either, it would be like 500++ tables on one database.

 

To explain better, my username is Paradox and I vote for Kristen Bell. When I look at this database I want to see:

 

ID    Title        Option1    Option2    People who voted option 1(27 people)        People who voted option 2(783 people)

1    Heroes    27            783            {Blah, Blah, Blah}                                      {Paradox, Blah, Blah}

 

Is an array a good way to go about this? Because I also want to be able to expand the array to notify each member they voted with the winning or losing team once the poll expires.

 

 

 

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.