Skip to content
Advertisement

Add Year to NOW()

I am trying to add a year to a date going into a SQL database from PHP. I have tried DATEADD(Year,1,NOW()) And various other forms but can’t seem to get it to add a year onto it in SQL.

JavaScript

Thank you very very much!

Advertisement

Answer

You are attempting SQL Server syntax in MySQL.

In MySQL, you would simply do:

JavaScript

Or:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement