[SOLVED] ORDER BY datetime Problems

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

[SOLVED] ORDER BY datetime Problems

Post by cbrian »

This code is part of a message board I'm making. This query gets the topic and the replies made to it, but it seems like the replies are ordered randomly, even though I've used ORDER BY `posted`

Code: Select all

$query = mysql_query("SELECT * FROM forum WHERE replied_to='{$_REQUEST['post']}' ORDER BY `posted` DESC");
It's a lot of code, and I think this is the only part that would really affect it.


EDIT: Sorry for wasting your time. I made a dumb mistake, it should be ordered ASCENDING. It works great now.
Last edited by cbrian on Sat Apr 02, 2005 12:45 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

post your table structures in SQL format, an export of some data stored in it, and what that data is being output as, versus what you want it to output as.
Post Reply