It's datetime alright.
it's storing datetime values in the format:
0000-00-00 00:00:00
This is the code I'm using:
$logquery = "SELECT message, UNIX_TIMESTAMP(entry_date) as thedatetime, lognumber, link_from_root FROM Logs ORDER BY `thedatetime` DESC limit 7";
$result = mysql_query($logquery) or die("<BR><B>Could not get logs</B>");
while ($a_log = mysql_fetch_row($result)) {
print date("l m/d", $a_log[1]) . " - $a_log[0]";
}
However is is not correctly sorting. What I want to happen is for the newest entries to be listed on top and the older ones listed below in reverse chronological order.
However with the following 6 datetimes from the 6 records in the database:
2002-09-17 01:09:51
2002-09-17 01:10:18
2002-09-17 01:09:28
2002-09-17 11:09:59
2002-09-17 01:09:15
2002-09-17 01:09:37
The resulted sort appears in this order:
2002-09-17 11:09:59
2002-09-17 01:10:18
2002-09-17 01:09:51
2002-09-17 01:09:37
2002-09-17 01:09:28
2002-09-17 01:09:15
when I'm trying, of course, to get them in this order:
2002-09-17 01:10:18
2002-09-17 01:09:51
2002-09-17 01:09:37
2002-09-17 01:09:28
2002-09-17 01:09:15
2002-09-17 11:09:59