xwishmasterx Posted May 1, 2011 Share Posted May 1, 2011 I have done a query from a table with a timestamp like so DATE(...) I have this value as $defend_started (if I do an echo on this I get: 2011-04-30) Can I use this variable against other dates? Perhaps even "DATE_ADD($defend_started, INTERVAL 1 DAY)" ? If not, than what are the alternatives? Link to comment https://forums.phpfreaks.com/topic/235299-more-coding-with-date-still-cant-figure-it-out/ Share on other sites More sharing options...
fugix Posted May 1, 2011 Share Posted May 1, 2011 are you asking if you can compare this date to other dates? Link to comment https://forums.phpfreaks.com/topic/235299-more-coding-with-date-still-cant-figure-it-out/#findComment-1209191 Share on other sites More sharing options...
xwishmasterx Posted May 1, 2011 Author Share Posted May 1, 2011 basically yes. Link to comment https://forums.phpfreaks.com/topic/235299-more-coding-with-date-still-cant-figure-it-out/#findComment-1209195 Share on other sites More sharing options...
Pikachu2000 Posted May 1, 2011 Share Posted May 1, 2011 DATE_ADD() is only available as a PHP function in PHP 5.3 and above, or as a MySQL function. Are you trying to do the math in a database query, or in PHP? Link to comment https://forums.phpfreaks.com/topic/235299-more-coding-with-date-still-cant-figure-it-out/#findComment-1209196 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.