Hi,
I am trying to select a category title from a category table, the number of threads in the thread table with the same category id, and the number of posts in the posts table again with the same category id.
The title, and thread count is working but the post count is just coming out the same as the threads.
Any advice appreciated!
select forum_categories.title, count(forum_threads.id) AS threads, count(forum_posts.id) AS posts from forum_categories LEFT JOIN forum_threads ON forum_threads.category='1' LEFT JOIN forum_posts ON forum_posts.category='1' WHERE forum_categories.id='1' GROUP BY forum_categories.id;