Workings of a forum

From: <groovee_at_cyberdude.com>
Date: Thu, 22 Nov 2018 00:45:16 -0800 (PST)
Message-ID: <bc4f3b9a-ac94-46c3-9726-7e2f23d1acc2_at_googlegroups.com>



I'm trying to program a "forum-ish" type of a site. I have 2 tables, one for threads containing the fields: primkey, title; and another for the actual posts with: username (who's posting), threadid (which is the primkey from the threads table), post (the post itself), timeposted.

[Quoted] [Quoted] What I want is, on the main page of the site, to display the thread titles WITH THE THREAD WITH THE LATEST POST FIRST (just as is done in so many places on the web!). What I'm not getting is how to sort the posts *in one particular thread* newest first, and *THEN* sort _that_ so that the OVERALL newest post is on top. This is what I came up with, I have a feeling it may not be enough (ignore the date and time stuff for the moment):

SELECT title FROM threads LEFT JOIN posts WHERE primkey.threads=threadid.posts GROUP BY threadid ORDER BY timeposted DESC;

What do I do next? Received on Thu Nov 22 2018 - 09:45:16 CET

Original text of this message