Azzyh Posted January 18, 2010 Share Posted January 18, 2010 Hi. I want to order the stuff that comes out of the query, by the closest dato matching and following. So like if the datetime right now is: 21/21/08 3:15 pm and theres a row with field "dato" that has 21/21/08 3:10 <- this should be the first on the top and then following.. hope you understand i tried myself alittle: $timenow = date('d/m/Y G:i:s'); ORDER BY dato < ($timenow) but doesnt seem to be right Link to comment https://forums.phpfreaks.com/topic/188903-order-by-dato/ Share on other sites More sharing options...
Buddski Posted January 18, 2010 Share Posted January 18, 2010 Does "ORDER BY dato DESC" or "ORDER BY dato ASC" give you what you want.. Link to comment https://forums.phpfreaks.com/topic/188903-order-by-dato/#findComment-997369 Share on other sites More sharing options...
al Posted January 18, 2010 Share Posted January 18, 2010 Or you could try: ORDER BY dato < NOW(); Link to comment https://forums.phpfreaks.com/topic/188903-order-by-dato/#findComment-997371 Share on other sites More sharing options...
Azzyh Posted January 18, 2010 Author Share Posted January 18, 2010 Thanks Buddski. ASC worked well for me Link to comment https://forums.phpfreaks.com/topic/188903-order-by-dato/#findComment-997390 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.