Jump to content


MySQL order by issue


3 replies to this topic

#1 TutNation

    Young Padawan

  • Members
  • Pip
  • 15 posts

Posted 03 October 2007 - 03:57 AM

I have installed a point system and when I try and order the leaderboard by the most points to the least points its ending up like this:

50
235
110

instead of

235
110
50

here is my query:
SELECT * FROM `TABLE` ORDER BY `points` DESC LIMIT 0,10

#2 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 03 October 2007 - 05:17 AM

What column type are you using, you may get somthing like that if your using varchar, in that case you need to use INT or another numerical column type so it can order by how its meant to be.

Matt

#3 TutNation

    Young Padawan

  • Members
  • Pip
  • 15 posts

Posted 03 October 2007 - 05:25 AM

oh, duh' of course, I forgot, thanks :)

#4 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 03 October 2007 - 06:21 AM

no worries.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users