If you find that you are having trouble sorting data in a VARCHAR column in a MySQL database then you can try the following trick.
Lets say that you had the values 1,200,30,4000 and 5 and that you inserted them into the database in that order. When the following query is run on this data:
SELECT numbers FROM table ORDER BY numbers;
The following output is seen.
This is clearly not the correct order, although it represents the order of. You can force a natural order to the sort by using a "+0" after the colum you are trying to sort by.
SELECT numbers FROM table ORDER BY numbers+0;
This produces the following output, which is sorted as you expect a set of numbers to be sorted.