Log in

View Full Version : arranging mysql data



sukanya.paul
07-01-2009, 08:03 AM
hi i have a table which has a field called month whose values are
January,February,March etc in no particular order

i am selecting all daya from this table and the month values are in the following order:
January
November
December
February
March
April
May
June
July
August
September
October

i want it to be displayed in the proper order
January
February
March
..
..
..
December

Can some1 please help me with this.
Thanks in advance
Suk

onestopplay
07-02-2009, 11:21 PM
Well...now I am new at PHP/MySQL...but from my understanding...
Make a new field called "id". Then assign January the id 1, February the id 2, and so on.
Then you can do:

$result = mysql_query("SELECT * FROM months ORDER BY id");