I have php and mysql running, the database has a table named torders and there are 3 fields that store the date (not my fault, was handed to me like this-i know better than this)
Field Name------------Sample data
date--------------------7
month------------------November
year--------------------2006
all i am trying to do is write an sql query to
- join / contatinate all these fields to make a string date
- convert the string date to a real date
- format the date to display as Tuesday, November 7, 2006
- Sort order by this date as well.
here is what i have done so far and i am stratching my head up and down.
$query1 = "Select str_to_date(day-month-year, '%d-%b-%Y') as modate from torders order by modate";
second try was
$query1 = "Select str_to_date(CONCAT(day,'-', month,'-', year), '%d-%b-%Y') as modate from torders";
then i gave up and did not try the //DATE_FORMAT(, '%d/%M/%Y')"; at all.
can any one of you great minds help