Order by lost posted in topic

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cbrian
Forum Commoner
Posts: 97
Joined: Sun Feb 27, 2005 12:29 pm

Order by lost posted in topic

Post 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;);
brandan
Forum Commoner
Posts: 37
Joined: Sat Jul 24, 2004 6:39 pm
Location: fort smith, ar

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

order the topics according to the posts table.

This can be done with a DISTINCT and a JOIN, I believe.
brandan
Forum Commoner
Posts: 37
Joined: Sat Jul 24, 2004 6:39 pm
Location: fort smith, ar

Post by brandan »

way out of my league. i'll just stop trying. :>
Post Reply