Anonymous

Anonymous
There was an example of displaying 10 recent posts, but what everyone needs is 10 recent posts in all forums, not just the one you specify. $sql = "SELECT t.topic_title, t.topic_id, f.forum_id FROM forum_topics t, forum_forums f, forum_posts p WHERE t.topic_id = p.topic_id AND f.forum_id = t.forum_id ORDER BY post_id DESC LIMIT 10"; this does the thing, but shows only 1 most recent post. Any hints?

Status: offline

Tony

Site Admin
Admin
Registered: 12/17/01
Posts: 405
You need a GROUP BY clause. Specifically you need to GROUP BY the ID fo the main thread. That will collapse all posts from the same thread an you should get 10 unique threads.---The reason people blame things on previous generations is that there's only one other choice.
The reason people blame things on previous generations is that there's only one other choice.

Anonymous

Anonymous
Good idea I suppose. I just didn't want to dump stuff from my private forums for the world to see. Razz