After I get 3 rows in my forum_threads
table this no longer does it's job. Which is to organize a list of active forum threads and put the most recently responded-to thread at the top of the list, followed by second most recent posted-to thread, followed by third, fourth, etc.
Like I said, the query works wonders up until there is a fourth row added to forum_threads
.
SELECT
forum_threads.*,
forum_posts.thread_id
FROM
forum_threads
INNER JOIN (
SELECT MAX(id) AS id, thread_id as thread_id
FROM forum_posts
GROUP BY thread_id
ORDER BY id DESC
) forum_posts ON forum_threads.id = forum_posts.thread_id