Got the following tables:
forms
- id
- name
questions
- id
- form_id
- type
- name
questions_translations
- id
- question_id
- lang_id
- label
- placeholder
poss_answers
- id
- question_id
- lang_id
poss_answers_translations
- id
- poss_answer_id
- value
Now I want to select all the questions and possible answers from 1 form, from 1 language. I can easily select all the elements without using the poss_answers_table:
SELECT b.*, f.* FROM app_questions q JOIN app_questions_translations qt ON q.form_id = 4 WHERE lang_id = 4 && qt.question_id = q.id
This gets me all the elements for the two tables, but now I want to add in the poss_answers table. This table holds all the possible answers for a select field, or a checkbox field, or radio field. These are the answers which can be choosen from.
But how can I do that within 1 query?