| Author |
Post |
|
|
#1 Sun Jun 18, 2006 7:30 am
|
|
Member
Registered: Jun 2006
Posts: 25
Location: Australia
|
Im trying to make a news system which calls the first post out of each topic in one forum. Only admins can start topics in this. Then this will be displayed on the home page. You know how it works!
Question: - How would I pull these exact posts out of the database, including author, date, total comments, page numbers. And have them display in order?
Help would be most appreciated.
|
|
|
#2 Sun Jun 18, 2006 8:11 am
|
|
Member
Registered: May 2005
Posts: 329
Location: Washougal, WA
|
|
|
|
#3 Sun Jun 18, 2006 9:57 am
|
|
Member
Registered: Jun 2006
Posts: 25
Location: Australia
|
Yer but from a particular forum and first post from each topic.
|
|
|
#4 Sun Jun 18, 2006 5:04 pm
|
|
Developer
Registered: Apr 2004
Posts: 2191
Location: Belgium
|
Quote SELECT t.id, t.topic_title, t.count_replies, t.count_views, t.status_locked, p.content, p.post_time, p.poster_id, u.displayed_name FROM usebb_topics t, usebb_posts p, usebb_members u WHERE t.forum_id = <forumid> AND t.status_sticky = 0 AND p.id = t.first_post_id AND u.id = p.poster_id ORDER BY p.post_time DESC LIMIT <numposts>
That's what I use on the front page. Basicly this is just standard SQL...
|