PDA

View Full Version : How are posts kept track of? {which forums they belong to)


Cruz
Thu 11th Oct '01, 3:09pm
I was browsing my mysql tables via phpmyadmin (i know, n00b ;)) and I am wondering how the posts are stored. When you look in the user table, you only see the number of posts, but you do not see which posts they are. Then you look under the posts table and you get all the user info. If i wanted to do a query to select all the posts from a certain user from a certain forum, how would I do it?
Also, how are the thread-starters stored? I have been trying to get a hack to work forever {select top thread poster} but as my limited knowledge only goes so far, i ask the masters now :)

holev
Sat 13th Oct '01, 3:49pm
first of all phpmyadmin owns :)

in the post table there is a 'userid' column and if u'd get that id and then select the 'user' table with it, u'd get the user's info.

thread starters are stored in the table 'thread'

hope i helped

orca
Sun 14th Oct '01, 5:09am
Well, it's a similar question. What would the query be to get the replies within a forum if it's possible? The posts are linked to the thread with threadid but I needed the forumid...

Chen
Sun 14th Oct '01, 9:25am
SELECT * FROM post LEFT JOIN thread USING (threadid) WHERE thread.forumid=1 LIMIT 10
Just change the forumid and/or limit.

orca
Sun 14th Oct '01, 12:22pm
thnx Firefly :)