I am creating surveys for our website and want store questions and answers
in a database. I found a tutorial that was useful, however it only gave
structure for a single question with one answer. My surveys need to be more
comprehensive than a poll question, and so I need some help with the
structure of my tables.

Currently, my database has these tables:
-user (for admin login, unrelated currently)
-survey_question
-survey_option
-survey_answer

Here is a breakdown of the fields for each:
-survey_question
---QuestionID - INT - primary key - auto_increment
---QuestionText - TEXT

-survey_option
---OptionID - INT - primary key
---QuestionID - INT
---OptionText - TEXT
---OptionValue - INT

-survey_answer
---AnswerID - INT - primary key
---AnswerValue - INT
---QuestionID - INT

I don't see how this can be sufficient, for example if I had a question with
multiple choices.

I want to be able to insert all surveys into these tables, taking into
consideration that there are many form input types. Can anyone let me know
if my structure is sufficient? This is all new and I'm learning as much as I
can.

Thanks!

Reply via email to