OhTheNoes Posted October 5, 2011 Share Posted October 5, 2011 Hi all, I've got a couple of these event entries with dates attached to them in the format of day-month-year (example: 31-01-2001) and I've got a script to display the name+date in a list. How could I go about making it so that it orders by the oldest on top like: Event A October 5, 2011 - October 8, 2011 Event B October 6, 2011 - October 7, 2011 Event C October 9, 2011 - December 1, 2011 Any help would be appreciated Quote Link to comment https://forums.phpfreaks.com/topic/248489-ordering-by-date/ Share on other sites More sharing options...
TOA Posted October 5, 2011 Share Posted October 5, 2011 Assuming you have it stored in a database and have a start and end field, this query should work. Works for varchar, text and datetime fields types SELECT * FROM `Table` ORDER BY Start ASC It would help to see some code though Quote Link to comment https://forums.phpfreaks.com/topic/248489-ordering-by-date/#findComment-1276084 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.