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
https://forums.phpfreaks.com/topic/231500-remember-user-optionsselection/
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.