I’ve 2 tables poll_questions and poll_answers. Each question has more than one answers. like question: do you smoke ? in poll_answers table probable answers are like “Yes”, “No”, “No answer”.
I wanna display all questions and answers from both in order like
-
do you smoke ?
ans:
a. yes
b. no
c. don’t know -
do you drink ?
ans:
a. yes
b. No
c. Don’t Know
I use select statement like
SELECT * FROM poll_questions INNER JOIN poll_answers on poll_questions.id = poll_answer.question_id WHERE poll_options.poll_id=1;
I don’t know how can I loop or use proper SELECT statement. Please help. Thanks in advance.