I'd like create simply polls manager (PHP and Apache).

I would like for instance options:

  1. good or bad (boolean in database)
  2. choose with own option (?)
  3. answerbox (varchar 5000)

Moderator have option create new pool. He want for instance:

  • two good or bad
  • one choose
  • two answer box.

How do i bare this in database? I do not have any idea :(

Here's a good example of how it may be implemented:

Two kinds of questions -- select (including yes/no questions) and text:

question_types
--------------
id   type
--------------
1    select
2    text

Table selects stores all choices for the choose question type:

selects
---------------------------------------------
id   select_id option_desc
---------------------------------------------
1    1         yes
2    1         no
2001 500       optionX
2002 500       optionY

Table polls stores polls data -- row for every answer with regards to selects table for choose question. Filled based on your example:

polls
-----
id poll_id type  select_id
-----------------------------
10 100     2     1
11 100     2     1
12 100     2     500
13 100     3
14 100     3

Table answers stores user's solutions. answer column references to selects.id for choose questions and also to answers_texts.id for texts questions:

answers
-----------------------------
id user poll_row_id answer
-----------------------------
1  5000 10          1
2  5000 11          2
3  5000 12          2002
4  5000 13          301
5  5000 14          302

The answer_texts tables stores solutions towards the text questions:

 answers_texts
 -----------------
 id  answer
 -----------------
 301 text1
 302 text2