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. Quote 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] Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/20512-order-by-2-rows/#findComment-90435 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.