Jump to content


Photo

mysql sort


  • Please log in to reply
1 reply to this topic

#1 dig412

dig412
  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 08 March 2006 - 10:13 PM

i'm using this query to retreive scores for a flash game:
SELECT * FROM fennec_game ORDER BY score DESC;

for some reason, a score of 9 will appear above a score of 89, as single digits are orderd incorectly. is there a way to fix this?
thanks in advance

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 08 March 2006 - 11:04 PM

As your scores are numbers, store them as numeric type (INT) and not as char type
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users