Simple Database Questions (Ordering Data)

Associate
Joined
12 Aug 2004
Posts
1,009
Location
Glasgow, Scotland
Hi there,

I have a fairly simple question that i've just stumbled across,

I've got a table with 10 rows of data in it, each piece of data has an ID from 1 -10 and i'm outputting the data onto a page by ordering it by the ID number.

So basically, in the table the data is as so...

1
2
3
4
5
6
7
8
9
10

but, when it is displayed onto the page by the order i get...

1
10
2
3
4
5
6
7
8
9

which is fair enough, i thought of just changing the first 9 digits to 01, 02 etc. but would that be the correct way of fixing the problem? is there another solution?

Cheers for any help/advice,

Steven.
 
The list is by default sorted alphabetically, you need it to be sorted by number order. It maybe that your field type is set to text instead of number.
 
tonyyeb said:
The list is by default sorted alphabetically, you need it to be sorted by number order. It maybe that your field type is set to text instead of number.

bah, ofcourse :rolleyes:, forgot the obvious!

cheers for that :)
 
Back
Top Bottom