Hi there,
I have 2 tables; "Projects" and "Projects_Details".
First table's fields;
- id
- project_no
-project_name
- last_update_datetime
Second table's fields;
- id
- project_no (it's lookup field that get data from first table)
When i add a new record to the second table, i want to add automatically date and time to the first table's "last_update_datetime" field (i mean i want to do that with "before update" or "after update" hook).
How can i do that?
Best Regards.
Update Another Table's DateTime Field
Re: Update Another Table's DateTime Field
Hi,
you can just add in the Projects_Details_after_update function:
you can just add in the Projects_Details_after_update function:
Code: Select all
sqlvalue("update Projects set last_update_datetime=now() where id = ".$data['project_no']);
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.