Hi all!
I’ve got a forum I wrote my self. I’ve got these two tables:
[code=php]
forums_threads
`id` int(150) NOT NULL auto_increment,
`title` varchar(75) NOT NULL default ”,
`text` text NOT NULL,
`user_id` int(50) NOT NULL default ‘0’,
`views` int(75) NOT NULL default ‘0’,
`date` datetime NOT NULL default ‘0000-00-00 00:00:00’,
`lastpost` datetime default ‘0000-00-00 00:00:00’,
`active` tinyint(1) NOT NULL default ‘1’
[code=php]
forums_replies
`id` int(50) NOT NULL auto_increment,
`tid` int(125) NOT NULL default ‘0’,
`text` text NOT NULL,
`user_id` int(50) NOT NULL default ‘0’,
`date` datetime NOT NULL default ‘0000-00-00 00:00:00’,
`active` tinyint(1) NOT NULL default ‘1’
What I want to do is to display the top 5 posts on the forums. I can display from “forums_threads” with no problem just using ‘LIMIT’ but then I don’t get all the replies. I can also display from “forums_replies” with no problem using ‘LIMIT’ but then I don’t get a new thread that hasn’t gotten any replies.
How can I display the top 5 posts over all the forum, both new threads and replies?
Thanks,
Magnus