pugboy Posted May 11, 2009 Share Posted May 11, 2009 I have two columns: order AND orderid How can I get all of the pages (which is what I am trying to order) to be ordered by the order column, then ordered by their ID? I tried ORDER BY `order` ASC, `orderid` ASC but it does not come out correctly... An example of what I want but can't seem to get to work: Page ID name - Order - Order ID: home - / - 1 docs - / - 2 user - /docs/ - 1 developer - /docs/ - 3 administrator - /docs/ - 2 I can't get the array to be ordered like this: home docs user administrator developer Is there a better way to do what I am trying to achieve, or am I not using the multiple order by thing correctly? Quote Link to comment https://forums.phpfreaks.com/topic/157749-solved-ordering-by-mutliple-fields/ Share on other sites More sharing options...
Ken2k7 Posted May 11, 2009 Share Posted May 11, 2009 ORDER BY order, orderid ASC Quote Link to comment https://forums.phpfreaks.com/topic/157749-solved-ordering-by-mutliple-fields/#findComment-832047 Share on other sites More sharing options...
pugboy Posted May 11, 2009 Author Share Posted May 11, 2009 It was that simple? Wow. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/157749-solved-ordering-by-mutliple-fields/#findComment-832048 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.