I'm sure this has been asked before but I can't get my code to work :(

There are multiple questions that are asked by users. I need to display users for a kinda user search and then display how many questions each user has asked.

Table 1 (Users):
id,
username,
password,
avatar,
reg\_date,
is\_banned (ETC...)

Table 2 (questions):
id,
questioner\_id,
question, 
answer 1,
answer 2,
answer 3 (ETC...)

I need to merge the two and then display normal user information like username etc but also count the questioner\_id rows and display how many questions that user has asked.

This is what I have so far but it just spits out one result and counts everything:

```
SELECT 
    users.id,
    users.username,
    users.avatar_location,
    users.datetime,
    users.last_action,
    users.last_action_description,
    users.is_banned,
    COUNT(questions.questioner_id)
FROM 
    `users` 
LEFT JOIN 
    `questions` 
ON 
    users.id = questions.questioner_id
ORDER BY
    datetime 
    ASC 

```

I am sorry in advance for my utter 'noobiness'. I've looked for an hour or two about how to do this but I haven't been able to fix it.

Thanks a lot

EDIT:

Thanks so much for your help! My final add-on questions is that I now have one more third table and this time I want to count the questions answered now that I have the questions asked.

Table 3 (questions\_answered):
id,
question\_id,
user\_id,
correct (ETC...)

I've tried adding it into my query but instead of display the count of questions answered it repeats the result of questions asked.

Here's my updated query (Sorry again, I'm just struggling to get my head around this)

```
SELECT 
    users.id,
    users.username,
    users.avatar_location,
    users.datetime,
    users.last_action,
    users.last_action_description,
    users.is_banned,
    COUNT(questions_answered.question_id),
    COUNT(questions.questioner_id)
FROM 
    `users` 
LEFT JOIN 
    `questions` 
ON 
users.id = questions.questioner_id
LEFT JOIN
    `questions_answered`
ON
    users.id = questions_answered.user_id
GROUP BY
    users.id,
    users.username,
    users.avatar_location,
    users.datetime,
    users.last_action,
    users.last_action_description,
    users.is_banned
ORDER BY
    datetime 
    ASC 

```

Just thank you so much for your help!