Mutley Posted September 12, 2006 Share Posted September 12, 2006 I'm wanting to order my news by date but if 3 articles are posted on 1 day, they arn't in order of time. So how do I order by id (each time it is submitted it is given an ID, latest news = biggest ID number).Something like this:[code]ORDER BY date DESC && ID DESC LIMIT 1[/code]Thanks. Link to comment https://forums.phpfreaks.com/topic/20512-order-by-2-rows/ Share on other sites More sharing options...
Jenk Posted September 12, 2006 Share Posted September 12, 2006 [code]ORDER BY date, id DESC[/code] Link to comment https://forums.phpfreaks.com/topic/20512-order-by-2-rows/#findComment-90434 Share on other sites More sharing options...
ober Posted September 12, 2006 Share Posted September 12, 2006 ORDER BY date DESC, ID DESC LIMIT 1ahh... beaten. Good one, Jenk... but at least my example shows that you can sort both ASC/DESC. Link to comment https://forums.phpfreaks.com/topic/20512-order-by-2-rows/#findComment-90435 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.