Got a small problem regarding selecting data in my MySQL table. I got 2 tables.
questions_table
- id
- name
results_table
- id
- form_id
- answer 1
- etc.
Now I want to select all the forms which has results, and the form_id matches the form id, because that is how they are linked.
I got this:
select f.id, f.name, count(res.id) from forms f LEFT JOIN results res ON f.id = res.form_id
But the problem is, I only get 1 row out of it, while I have multiple forms with multiple results, but it only selects the one form.
What am i doing wrong? Is it the LEFT JOIN statement?