Ninjakreborn Posted July 30, 2010 Share Posted July 30, 2010 I have a datetime field. Is there a Mysql function or PHP side something I can do to pull out only the results that are 4 days from today? Quote Link to comment https://forums.phpfreaks.com/topic/209356-question-about-dates/ Share on other sites More sharing options...
Maq Posted July 30, 2010 Share Posted July 30, 2010 http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-add Quote Link to comment https://forums.phpfreaks.com/topic/209356-question-about-dates/#findComment-1093176 Share on other sites More sharing options...
Daniel0 Posted July 30, 2010 Share Posted July 30, 2010 I have a datetime field. Is there a Mysql function or PHP side something I can do to pull out only the results that are 4 days from today? function selectFromLastDays($num = 4) { // implementation left as an exercise for the reader } Quote Link to comment https://forums.phpfreaks.com/topic/209356-question-about-dates/#findComment-1093181 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.