Parent table :
Id
Name
Child table :
Id
Parent_id
Name
Now i want to insert child table automaticaly in before insert hooks on parent table
I've tried so many many times but what i got is always same
The value of parent_id is always 0
Can anyone help me?
Help how to insert id from parent table to child table
-
- Posts: 27
- Joined: 2015-12-19 03:59
Re: Help how to insert id from parent table to child table
function files_after_insert($data, $memberInfo, &$args){
sql("INSERT INTO child table (Parent_id) values ({$data['selectedID']})", $eo);
sql("INSERT INTO child table (Parent_id) values ({$data['selectedID']})", $eo);
Last edited by xbox2007 on 2018-11-16 21:34, edited 1 time in total.