It should be 7 rows. Going from ID’s, 1, 2, 3, 4, 5, 6, 7.
What I have instead are ID’s 2, 2, 6, 7, 1, 5, 6, 5, 5, 5, 2, 4, 4, 7 and so on.
Not to mention that they spawn incorrect results (talking about lastTopicAuthorId and lastTopicAuthorName).
Anything “forums” related, seems fine.
members.id lastTopicPosterId,
members.username lastTopicPosterName,
forums.id forumId,
forums.name forumName,
forums.description forumDescription,
forums.lastTopicId forumLastTopicId,
(SELECT COUNT(*) FROM topics WHERE topics.parent = forums.id) forumTopicCount,
topics.id forumLastTopicId
FROM forums
LEFT OUTER JOIN members ON members.id = forums.lastTopicId
LEFT OUTER JOIN topics ON forums.lastTopicId = topics.id```
and everything worked out. I just made couple changes and it exploded :|
Also, there's no difference between what you've written and what I had.