Yes your problem arise because you have use
a CHAR type for the field instead of
a DATETIME type.
Use a DATETIME and your sorting pb will go
away :-)
For extracting date from MySQL format I've coded a small function :
function ExtractMySQLDate ($MySQLDate)
{
global $SQLDate;
$SQLDate["year"] = substr ($MySQLDate,0,4);
$SQLDate["month"] = substr ($MySQLDate,5,2);
$SQLDate["day"] = substr ($MySQLDate,8,2);
$SQLDate["hour"] = substr ($MySQLDate,11,2);
$SQLDate["min"] = substr ($MySQLDate,14,2);
$SQLDate["sec"] = substr ($MySQLDate,17,2);
}
The parameter is the date in MySQL format
and the function will feed global var
"SQLDate" which is an associative array
Example of use :
$temp_date = $myrow["date_creation"];
ExtractMySQLDate($temp_date);
$day = $SQLDate ["day"];
$month = $SQLDate ["month"];
$year = $SQLDate ["year"]