suttercain Posted November 22, 2007 Share Posted November 22, 2007 Hi guys, I think the title asks the question I am seeking an answer for. The database stores dates in a 1/5/1995 format (month/day/year) Can I have the results ORDER BY coverdate? Thanks, SC Quote Link to comment Share on other sites More sharing options...
snk Posted November 22, 2007 Share Posted November 22, 2007 of course you can, if you want to reverse the order of result use the DESC at the end of your query e.g ..ORDER by f_date DESC; Quote Link to comment Share on other sites More sharing options...
suttercain Posted November 22, 2007 Author Share Posted November 22, 2007 I got it... $query = mysql_query("SELECT *, STR_TO_DATE(cover_date,'%d/%m/%Y') as Mydate FROM comics WHERE title = '".mysql_real_escape_string($search)."' AND type ='Comic Book' ORDER BY Mydate") or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
snk Posted November 22, 2007 Share Posted November 22, 2007 ouchhh ok, sorry i thought you wanted to order the data... thanks for replying the solution Quote Link to comment 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.