I have (stupidly) made a website where, when people update their accounts, it inputs the date that they last updated their account into the database as a textual date rather than a Unix timestamp. So, I am trying to sort the lastest updated accounts in a MySQL query by their last updated date (c_last_edit), but it sorts them alphabetically from the first letter of the month rather than how it actually should sort them.
Here is an example of the date format I am trying to sort the queries by: April 13, 2009, 6:08 am and, obviously, it sorts the fields by the first letter of the month rather than by the day, month, and year as it should.
Here is what my query looks like, and (as mentioned before) it sorts the c_last_edit field by the first letter of the month instead of how it normally should.
Thank you to anyone who gives me good suggestions. I would switch the site to use timestamps for dates instead of using textual dates, but it would take too long considering how many accounts have been created and how many fields I would have to manually edit.
Here is an example of the date format I am trying to sort the queries by: April 13, 2009, 6:08 am and, obviously, it sorts the fields by the first letter of the month rather than by the day, month, and year as it should.
Here is what my query looks like, and (as mentioned before) it sorts the c_last_edit field by the first letter of the month instead of how it normally should.
PHP Code:
$sql_updated = "SELECT c_id, c_name, c_author, c_last_edit FROM characters WHERE c_status='1' AND c_last_edit!='none' ORDER BY c_last_edit DESC LIMIT 4";
Comment