Gossamer Forum
Home : General : Internet Technologies :

Ordering MySQL Numerically

Quote Reply
Ordering MySQL Numerically
Is there anyway to order a MySQL Query numerically? I'm grabbing a list from my database and ordering it according to "chapter number". When displayed, I get an "alphabetical" list which doesn't work out:

1
10
2
3
4
5
etc.

I need 10 to come after 9 and 20 after 19, etc.
Any help, much appreciated.
Quote Reply
Re: [JoFrRi] Ordering MySQL Numerically In reply to
Hi,

Make sure your column type is a numeric type, not a char or varchar.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Ordering MySQL Numerically In reply to
lol so simple. Thanks that was my problem.