How do I add 11 months to current date in php?

I have tried mysql: “ADDDate(’$currdate’, INTERVAL 11 MONTHS)” and can not get that to work (I get a Parse error). Can I accomplisht this via php?


  • Fred

I don’t think there is an easy PHP function that will do it, but if you look at and maybe a user put a comment with a function that will help you…

A parse error is a PHP problem, so what is the line of code you are using? What Mysql or PHP errors are you getting?

Thanks for the quick response! Here is what’s going on - I’m trying to insert the date of today + 11 months into mysql when a user completes a registration form. My insert statement is:
insert into billing (ppl_seq_id, bill_date, due_date, paid_date,billed)
values ($ppl_seq, ADDDate(’$currdate’, INTERVAL 11 MONTHS),null,null,‘N’);
$ppl_seq and $currdate are php variables within my program. If I take out the ADDDate() section of the insert and replace it with my $currdate variable, I don’t get any errors. When I use the ADDDate() mysql function, I get the php parse error. It doesn’t make sense to me. Any suggestions on making the mysql work? That would probably be the best way to handle it if I can get it to work.


  • Fred

change MONTHS to MONTH.

I tested it going to myphpAdmin, and doing a


when I used MONTHS I got a parse error. MONTH however works.


MP3Mystic Your personal Streaming MP3 Server
Dreamhost Hosting

Thanks Jason - you da man! I will try this as soon as I get off work :o)

  • Fred