Hello,
I want to only grab the last post of all topics in a category (Category->Forum->Topic->Post) from a phpbb database in a single query. Currently I have cooked up this, but it returns only the first post, not the last.
SELECT *, MAX(p.post_id)
FROM phpbb_forums f, phpbb_topics t, phpbb_posts p
WHERE f.parent_id IN (<categories>)
AND t.forum_id = f.forum_id
AND p.topic_id = t.topic_id
GROUP BY p.topic_id
Does anybody know how to correctly do this?