Hey all php newbie here. I'm trying to order a query by a date field. I've read around and it looks like the correct sql formatting is YYYY-MM-DD, however my current date format is DD.MM.YY
I've tried the following and it is not sorting correctly (I'm guessing because of the date format):
"SELECT * FROM tbl_hq_press_releases ORDER BY pr_dateAdded DESC";
What is the easiest way to format pr_dateAdded in this statement? I've been browsing the forums and a lot of people are using a DATE_FORMAT() function, but that seems to be undocumented by php.net.
Thanks for the help.
Order by date
Moderator: General Moderators
Re: Order by date
you need to look at the MySQL manual, not the PHP onegeorge3380 wrote:
What is the easiest way to format pr_dateAdded in this statement? I've been browsing the forums and a lot of people are using a DATE_FORMAT() function, but that seems to be undocumented by php.net.
http://www.mysql.com
Mark