scrubbicus Posted May 22, 2009 Share Posted May 22, 2009 So I'm trying to create an ORDER BY for all four columns in my table (name, price, date, and category) three out of four are ordering the way I want them to but price is ordering by the first highest numerical digit rather by then how many total digits there are. So $6 is higher then $2000 in this case and $10000 is lower then both of them. How would I go about ordering the price column by highest and lowest? Link to comment https://forums.phpfreaks.com/topic/159312-solved-using-order-by-value-descasc-for-a-price-table/ Share on other sites More sharing options...
Ken2k7 Posted May 22, 2009 Share Posted May 22, 2009 By not storing price as a string, but a number and format it in the output. Link to comment https://forums.phpfreaks.com/topic/159312-solved-using-order-by-value-descasc-for-a-price-table/#findComment-840223 Share on other sites More sharing options...
scrubbicus Posted May 22, 2009 Author Share Posted May 22, 2009 Damn totally knew that haha thanks. Link to comment https://forums.phpfreaks.com/topic/159312-solved-using-order-by-value-descasc-for-a-price-table/#findComment-840275 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.