kts Posted March 12, 2009 Share Posted March 12, 2009 Hey, I am ordering by name ASC, but some of the names are numbers as well as strings. The issue that is occurring is the numbers are sorting 1, 10, 10.5 etc as opposed to 1,2,3,4,5,....10,10.5 etc Is there an easy fix for this? Quote Link to comment https://forums.phpfreaks.com/topic/149161-solved-order-by-problem-with-names-and-numbers/ Share on other sites More sharing options...
kts Posted March 12, 2009 Author Share Posted March 12, 2009 ok adding + 0 before ASC will sort the numbers properly, but as far as doing both, I had to do an if checking if i was looking for numbers or text. Thanks! Solved. Quote Link to comment https://forums.phpfreaks.com/topic/149161-solved-order-by-problem-with-names-and-numbers/#findComment-783210 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.