npsari Posted April 26, 2007 Share Posted April 26, 2007 I store date in my database using: $Date = date("Y/m/d"); And I store Time using: $tim = localtime(time(),true); $Time=($tim['tm_hour'].":".$tim['tm_min'].":".$tim['tm_sec']); Now, I want to sort Posts... the Latest posted at the Top... SORT BY Date DESC When I do that, the Time damages the sequence SORT BY Time DESC When I do that, the Date damages the sequence How can I sort results by Date and Time Link to comment https://forums.phpfreaks.com/topic/48763-sorting-results-so-the-latest-comes-on-top/ Share on other sites More sharing options...
Barand Posted April 26, 2007 Share Posted April 26, 2007 SELECT ... FROM table ORDER BY date DESC, time DESC Link to comment https://forums.phpfreaks.com/topic/48763-sorting-results-so-the-latest-comes-on-top/#findComment-238975 Share on other sites More sharing options...
npsari Posted April 26, 2007 Author Share Posted April 26, 2007 thanksfor the info Link to comment https://forums.phpfreaks.com/topic/48763-sorting-results-so-the-latest-comes-on-top/#findComment-238980 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.