Page 1 of 1

Order by lost posted in topic

Posted: Fri Apr 01, 2005 8:46 pm
by cbrian
I'm working on a forum, and I'm trying to make the view topics list so that it displays the last topic posted in, unstead of just the last topic posted. Here's what I have so far, what do I have to do to change it?

Code: Select all

$query = mysql_query(&quote;SELECT * FROM `forum` WHERE `show`='1' AND `type`='topic' AND `sticky`='0' AND board='{$_REQUESTї'board']}' ORDER BY posted DESC&quote;);

Posted: Fri Apr 01, 2005 9:00 pm
by brandan
i would think that 'last_post_date' as date and 'last_post_time' as time would be useful for this sort of thing.

Posted: Fri Apr 01, 2005 9:04 pm
by feyd
order the topics according to the posts table.

This can be done with a DISTINCT and a JOIN, I believe.

Posted: Sat Apr 02, 2005 12:22 am
by brandan
way out of my league. i'll just stop trying. :>