esandra Posted October 21, 2010 Share Posted October 21, 2010 Hi. I am having problems arranging some elements. This is what happens when we do an 'order by field_name asc': 0302MZ2010 0401ML2010 0505ML2010 0610ML2009 0615MZ2010 This is what I want to happen: 0302MZ2010 0401ML2010 0505ML2010 0615MZ2010 0610ML2009 Arrange the year in desc order and the rest should be in asc order. Now, I'm very confused and I don't know how to do this. Thanks a lot and have a nice day. Link to comment https://forums.phpfreaks.com/topic/216445-phpproblem-in-sorting-of-elements/ Share on other sites More sharing options...
Pikachu2000 Posted October 21, 2010 Share Posted October 21, 2010 If each of those values is stored in one field, they're sorted properly. What is the structure of that table, and what are the data types of the fields? Link to comment https://forums.phpfreaks.com/topic/216445-phpproblem-in-sorting-of-elements/#findComment-1124918 Share on other sites More sharing options...
fenway Posted October 23, 2010 Share Posted October 23, 2010 Then you'll need to order by each part separately. Link to comment https://forums.phpfreaks.com/topic/216445-phpproblem-in-sorting-of-elements/#findComment-1125638 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.