Canman2005 Posted October 11, 2008 Share Posted October 11, 2008 Hi all I have a date stored in my db, example would be 2008-11-32 I output it as print $row['expdate'] How can I add 3 months to that date and out put it as YYYY-MM-DD. Everything I try doesnt seem to have any effect. Thanks Ed Quote Link to comment https://forums.phpfreaks.com/topic/127967-solved-date-plus-3-months/ Share on other sites More sharing options...
JasonLewis Posted October 11, 2008 Share Posted October 11, 2008 Something like this: #SQL: SELECT DATE_ADD(date, 3 MONTHS) as date FROM table WHERE something='something' Quote Link to comment https://forums.phpfreaks.com/topic/127967-solved-date-plus-3-months/#findComment-662648 Share on other sites More sharing options...
Canman2005 Posted October 11, 2008 Author Share Posted October 11, 2008 Hi, that seems to cause an error, any other methods I could try? Quote Link to comment https://forums.phpfreaks.com/topic/127967-solved-date-plus-3-months/#findComment-662663 Share on other sites More sharing options...
JasonLewis Posted October 11, 2008 Share Posted October 11, 2008 What's the error? My MySQL isn't too flash. :\ Quote Link to comment https://forums.phpfreaks.com/topic/127967-solved-date-plus-3-months/#findComment-662669 Share on other sites More sharing options...
Canman2005 Posted October 11, 2008 Author Share Posted October 11, 2008 It's ok thanks, managed to track down a script via google Quote Link to comment https://forums.phpfreaks.com/topic/127967-solved-date-plus-3-months/#findComment-662672 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.