iceblox Posted May 31, 2007 Share Posted May 31, 2007 I have an orderby in my query and when i do "ORDER BY price ASC" the output looks like this.. 140000 40000 50000 Is it me or is that wrong? Im sure there is a simple quick fix but i dont know what. Any help would be apprecaited. Thanks Link to comment https://forums.phpfreaks.com/topic/53770-solved-40000-bigger-than-140000-in-a-order-by/ Share on other sites More sharing options...
redarrow Posted May 31, 2007 Share Posted May 31, 2007 look up mysql max function. Link to comment https://forums.phpfreaks.com/topic/53770-solved-40000-bigger-than-140000-in-a-order-by/#findComment-265790 Share on other sites More sharing options...
obsidian Posted May 31, 2007 Share Posted May 31, 2007 Your query is treating your price field as a string rather than a number. What data type is your column? It should be either a numeric or float (depending on your database). Link to comment https://forums.phpfreaks.com/topic/53770-solved-40000-bigger-than-140000-in-a-order-by/#findComment-265794 Share on other sites More sharing options...
iceblox Posted May 31, 2007 Author Share Posted May 31, 2007 Thanks obsidian, Changed it to float and now it works right! Thanks Link to comment https://forums.phpfreaks.com/topic/53770-solved-40000-bigger-than-140000-in-a-order-by/#findComment-265796 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.