runnerjp Posted March 15, 2010 Share Posted March 15, 2010 23/05/2010 10,000m Track BMAF 10k - Oxford Set a PB 15/05/2010 Other Road BMAF Road Relays - Sutton Park, Birmingham Get in the team! 06/06/2010 10,000m Road 10km Road Championship - Bispham, Blackpool Set a PB! Is how its showing it... im using a query $getthreads ="Select * from races ORDER BY DATE_FORMAT(date, '%d-%m-%Y') ASC"; what am i doing wrong?? Quote Link to comment https://forums.phpfreaks.com/topic/195305-date_formatdate-d-m-y-asc-not-working/ Share on other sites More sharing options...
PFMaBiSmAd Posted March 15, 2010 Share Posted March 15, 2010 Per your other thread where someone explained why you can only compare dates that have a YYYY-MM-DD (or similar left to right, most significant to least significant, y,m,d field order), you can only sort or order dates that have that format for the same reason (sorting and ordering involves comparisons.) If your date column is a mysql DATE or DATETIME data type, you can use it in an ORDER BY term directly. Quote Link to comment https://forums.phpfreaks.com/topic/195305-date_formatdate-d-m-y-asc-not-working/#findComment-1026318 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.