Hi,
i have parent table items as ,
1) id
2) item_name
3) current_location (readonly)
child table as location transfer as,
1) id
2) item_id
3) new_location
i need to update current_location from child table as per last entry of new_location field .
please help . thanks
Update parent table field from child table.
-
- Veteran Member
- Posts: 32
- Joined: 2021-06-12 21:01
Re: Update parent table field from child table.
Code: Select all
function location_after_insert($data, $memberInfo, &$args) {
$item = $data['item_id'];
$location = $data['new_location'];
sql("update items set current_location = '{$location}' where id ='{$$item}' ", $eo);
return TRUE;
}
-
- Veteran Member
- Posts: 32
- Joined: 2021-06-12 21:01
Re: Update parent table field from child table.
thank you sir !!!