Hi,
I hope I understood what you was looking for. Your explanation is a bit confusing... for the little French I am 🙂
To implement a Q&A system, you need 3 tables: Questions, Choices and Answers.
A question is defined by its name and choices.
A choice is defined by its parent question and the choice itself.
An answer is defined by its parent question and a choice.
Questions = Id, Question, NbChoices
Choices = Id, QuestionId, Choice
Answers = QuestionId, ChoiceId
You could also use the Questions table to store the Answer but some questions might allow multiple choices... And your system is limited to 3 choices.
YES or NO
Question = 103, Are you there, 1
Choices = {500, 103, Yes}, {501, 103, No}
If you answer Yes, then Answers = 103, 500 (Yes for Question "Are you there" identified by 103)
2 Whose there? ME NO ONE BOB
Question = 104, Whose is there ?
Choices = {502, 104, Me}, {503, 104, No one}, {504, 104, Bob}
...
The second query needs to take all the answers
SELECT * FROM Answers WHERE QuestionId=$QuestionId
So I assume you would need an array for each questions answers
The idea is to design your database, so the tables from your idea. You ask a question, you can pick an answer from one or more choices. Question, Answer and Choice... It's just about logic 🙂
You can checkout the PHPBuilder snippet library or other script resources, there are dozens of Survey/Poll system (Q&A).
I hope it helps,
JM