为access_end日期增加一年的SQL更新语句


SQL update statement to add one year to access_end date

我可以在PHP编码,但我不擅长SQL。我需要在表上运行更新,以便传入给定的user_id,并将用户拥有的所有产品的"access_end"日期设置为从今天的日期起一年。

任何帮助都非常感谢

数据库为MySQL

表名是dap_users_products_jn

数据库中相关的字段有:

user_id | access_end_date | product_id
1       |   2012-10-26    | 34
1       |   2012-11-21    | 30
1       |   2012-12-22    | 3
2       |   2012-10-20    | 34
2       |   2012-07-18    | 30
2       |   2012-08-15    | 3
...etc
update dap_users_products_jn
set access_end_date = date_add(now(), interval 1 year)
where user_id = 1