views:

39

answers:

1

If you would want to make a poll system that supports multiple answers (options) (not just yes/no) how would you do it? How would you structure the db etc?

I don't want to limit the answers/options.

Some input on this would be greatly appreciated.

+1  A: 

Here is what I used:

Pool table:

pool_id: int
pool_name: varchar
number_of_votes: int

Pool_question table:

question_id: int
pool_id: int
question: varchar
answer: varchar
question_selected_count: int
BarsMonster
Or, you could do it with minor changes - with NO number_of_votes in pool (because number of votes in pool = SUM answer votes) and question in pool (because you have multiple answers for one question)
Adam Kiss