Tom, it should only be doing that if the column is set up as a string column (char, varchar). If possible, convert it to a numeric column (int, tinyint, etc), and the sort order should then be correct.
If not possible, then you might explore use of the CAST function. Dan On 9/28/06, Tom Ray [Lists] <[EMAIL PROTECTED]> wrote:
I'm running into a problem with a ratings script I'm writing. The overview is that a user can rate an item from 1-10. What I want it to do is display the highest rated item, with 10 being the highest rating. In case there are multiple items sharing the same score, the item that has been rated the most should be displayed. Here's a bit of the code: $albums=mysql_query("SELECT albumRating,totalRatings WHERE albumType='Album' ORDER BY albumRating,totalRatings DESC"); The problem I'm running into is that it always displays the item with a 9 rating and not the 10. I'm figuring it's because mysql is seeing the order as 9,8,7,6,5,4,3,2,10,1 Am I going to have to store the numbers as 01,02,03,etc... in order to get this to work right or is there a better way to structure the query? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]