gordon.c Posted April 14, 2009 Share Posted April 14, 2009 Hi, Simply I have been having issues with MySQL algorithms. The problem is when I try to retrieve an ordered list, MySQL does it usually wrong. You can see that on the pic below. You can see the syntax is correct since the phpMyAdmin has processed it, you can see the arrow indicating descending order but the values just dont seem right. Have you got any ideas what might be the cause and how to get rid or it? P.S. I am not trying to fool anyone here. This is unfortunately real situation. No photo montage has been made. Link to comment https://forums.phpfreaks.com/topic/154097-solved-weird-mysql-math/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 14, 2009 Share Posted April 14, 2009 If you make your column an INT (integer) to match the data in it, it will sort correctly. It's a string/character type now and that is how strings are ordered. Link to comment https://forums.phpfreaks.com/topic/154097-solved-weird-mysql-math/#findComment-810039 Share on other sites More sharing options...
gordon.c Posted April 14, 2009 Author Share Posted April 14, 2009 Oh right... I didnt think of that before Thank you for explaining Link to comment https://forums.phpfreaks.com/topic/154097-solved-weird-mysql-math/#findComment-810092 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.