php_begins Posted February 2, 2012 Share Posted February 2, 2012 I have a date field in the database table of this format 2012-02-08. Now I want to select fields from the database where date >= $currentdate. Do I have to do someting like $currentdate=time(); //Then convert it into YYYY-MM-DD format? Quote Link to comment https://forums.phpfreaks.com/topic/256270-date-format/ Share on other sites More sharing options...
Pikachu2000 Posted February 2, 2012 Share Posted February 2, 2012 SELECT fields FROM table WHERE date >= CURDATE() MySQL has a bunch of native date/time functions HERE. Quote Link to comment https://forums.phpfreaks.com/topic/256270-date-format/#findComment-1313743 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.