Page 1 of 1

Ordering by numbers???

Posted: Mon Sep 08, 2003 12:30 am
by Mr. Tech
I want to record the highest keywords searched. When someone searches it adds the info into the database like this:

id, word, searched

That works fine. When I go to display the results I use this query:

select * from keywords order by search desc

What that does is display the keywords wrong. Instead of going:

1
2
3
4
5
6
7
8
9
10
...
100


It would put:

1
10
100
2
20
3
30
4
40
5
50
6
60
...


How do I get it to show it correctly?

Thanks :)

Posted: Mon Sep 08, 2003 5:26 am
by zenabi
Make sure your searched field is of type int and use the following SQL statement:

SELECT * FROM keywords order by searched

Posted: Mon Sep 08, 2003 5:16 pm
by Mr. Tech
Awesome! It worked! Thanks