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
getting forums messages
Moderator: General Moderators
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
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 ?
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 ?