Copy date from one record to another with offset

I am not sure how to do this but here are the details.
I have 2 tables with a one to many relationship.
The first table has the following fields
Table name "main"
Cardno
frequency
duedate
...
...
etc
Second table "subtable"
Cardno
mtnce_date
...
...
etc
What I would like to do is, when the subtable field "mtnce_date" is updated, I would like to update the field in the "main" table called "duedate" with mtnce_date+frequency. The frequency field contains a number ie "12" which is the number of months between service periods, the other two are date field of course.
I think I should use a trigger but I am not sure if I should use SQL or PHP or how to reference the fields and of course only update the related record.
Thank you in advance for any help.
I have 2 tables with a one to many relationship.
The first table has the following fields
Table name "main"
Cardno
frequency
duedate
...
...
etc
Second table "subtable"
Cardno
mtnce_date
...
...
etc
What I would like to do is, when the subtable field "mtnce_date" is updated, I would like to update the field in the "main" table called "duedate" with mtnce_date+frequency. The frequency field contains a number ie "12" which is the number of months between service periods, the other two are date field of course.
I think I should use a trigger but I am not sure if I should use SQL or PHP or how to reference the fields and of course only update the related record.
Thank you in advance for any help.