|
Showing data from a table based on infos from another table!
Ok let me explain:
i have 2 tables in my database : THREAD, and POST
THREAD's rows are: THREADID, TITLE + FORUMID + REPLYCOUNT + VIEWS
POST's rows are: THREADID, PAGETEXT and PARENTID
i'm a big php newbie... I want to display the LAST TWO messages (highest THREADID) of my forum number 99 (FORUMID=99).
I can probably do that, but the problem is that the text of the message is located in another table.. and it's getting too hard for my low-skilled brain lol
so basically I would like to check in "THREAD" for the highest THREADID where FORUMID=99, display the TITLE, REPLYCOUNT and VIEWS, and then check in POST for the same two THREADID's where PARENTID=0 (meaning it is the first message in the thread) and finally display the PAGETEXT !
Could anyone give me a PHP code that would display that?
thanks a lot and sorry for bothering you with my newbie questions!
|