I would like to get numbers of comments for each posts using mysql.
I have two tables, one is post table and the other is comment table. Post table has id, title and content field while comment has id, post_id, author and comment field.
The result that would like to achieve is like
---------------------------------------------
Title Comment Count
---------------------------------------------
My fancy post 2
---------------------------------------------
Let me know if you have confusion about my question.
This will account for posts that don’t have any comments.