Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » sql: display latest topics on homepage
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
sql: display latest topics on homepage [message #23163] Mon, 07 March 2005 07:37
!alex is currently offline  !alex   Germany
Messages: 23
Registered: February 2004
Location: germany
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Here`s a small sql-statement to get the latest topics from the forum.

I use it to display them on all pages of our shop:


//use forum`s database:
mysql_query('USE '.$forumDb);

//the query:
SELECT fud25_msg.subject AS ThreadName, fud25_thread.id AS ThreadId
FROM fud25_thread, fud25_msg
WHERE fud25_thread.root_msg_id = fud25_msg.id AND fud25_thread.moved_to = 0
ORDER BY fud25_msg.post_stamp DESC

//generate link to topic (for path-info), while loop over results:

//switch back to the other database:
mysql_query('USE '.$yourDatabase);

You can have a look at www.schmid-gartenpflanzen.de

Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: small typo in rdf.php
Next Topic: The user's options bitmask...
Goto Forum:

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Sep 26 04:56:43 EDT 2018

Total time taken to generate the page: 0.00662 seconds