forumnz Posted September 18, 2007 Share Posted September 18, 2007 Alright. If I have a db for an auction site and I want to display the auctions closing soonest, how do I do this? I know how to code it, just the theory behind it? Thanks a lot, Sam. Link to comment https://forums.phpfreaks.com/topic/69791-ordering-from-db/ Share on other sites More sharing options...
GingerRobot Posted September 18, 2007 Share Posted September 18, 2007 Well, presumably you have an ending time for each item in the database? You'd then simply order by this value: <?php $sql = mysql_query("SELECT * FROM `yourtable` WHERE `somefield`='somevalue' ORDER BY `ending` DESC") or die(mysql_error()); ?> Link to comment https://forums.phpfreaks.com/topic/69791-ordering-from-db/#findComment-350630 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.