Page 1 of 1

getting forums messages

Posted: Thu Dec 02, 2004 7:32 am
by nosti
lets say i have these tables:

forums [id, opendate, title]
^
forums info table

forumsmessages [id, writedate, userid, content, replytoid]
^
message info: who wrote it, when, what and in reply to which messsage (if NULL, its a new message)

How do i get them all in on SELECT from the DB in the right order, the order in which i can just print them

i thank you very much if you can help me

Posted: Thu Dec 02, 2004 8:00 am
by CoderGoblin
Look up JOINS in an SQL manual.
You also need to look at ORDER BY.

Quick hint...

SELECT x,y FROM table1,table2 WHERE table1.join_col=table2.join_col ORDER BY x,y DESC;

NOTE: Whilst I don't mind helping (and I think I speak for the majority of people on this forum), it would be better if you could spend a bit of time doing some research/reading first. After all why should we spend time helping you when you don't spend time helping yourself ?