I'm trying to change a sorting by date of stores localized in my map (WP plugin: store-locator-le) with PHP and MySql. I insert the date in Phone field, so before I have to change the field in date. can you help me?
$this->dbQuery = apply_filters('slp_mysql_search_query',
"SELECT *,STR_TO_DATE(sl_phone, '%d-%m-%Y') as date ".
"FROM store_locator ".
'ORDER BY date ASC'
);
if I write the sql code in mysql phpmyadmin, it works!