UnknownPlayer Posted September 24, 2011 Share Posted September 24, 2011 Hi, how can i make to auctions be ordered by top field(it will have 0, 1 and 2 values) in mysql to order first by '2' then '1' then '0', and all that to be ordered by date DESC, can that be done ? Example(timestamp is not correct, but its example) id times text top ---------------------------------- 1 2 text1 0 2 10 text2 0 3 20 te32 0 4 15 te123 0 5 6 text1 0 6 7 text2 0 7 8 another 1 8 9 sadasd 2 9 10 hi 3 To be ordered like this: 9 10 hi 3 8 9 sadasd 2 7 8 another 1 3 20 te32 0 (time is 20 here, to order by highest..) 4 15 te123 0 2 10 text2 0 6 7 text2 0 5 6 text1 0 1 2 text1 0 Link to comment https://forums.phpfreaks.com/topic/247767-order-by-top-auction-then-by-date/ Share on other sites More sharing options...
Pikachu2000 Posted September 24, 2011 Share Posted September 24, 2011 Look Here. Link to comment https://forums.phpfreaks.com/topic/247767-order-by-top-auction-then-by-date/#findComment-1272340 Share on other sites More sharing options...
fenway Posted September 24, 2011 Share Posted September 24, 2011 ORDER BY FIELD(....). Link to comment https://forums.phpfreaks.com/topic/247767-order-by-top-auction-then-by-date/#findComment-1272411 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.