I have a project and it has 2 tables;
Table_1 : id, project_no, project_name
Table_2 : id, project_no(lookup from table_1), comment
First i add two records to table_1;
id=1
project_no = 1234
project_name = hello
id=2
project_no = 5555
project_name =bye
Then i add a record to table_2;
id=5
project_no = 1234 (selected from lookup)
comment = it's good
I added following codes to table_2 hookup file;
Code: Select all
function table_2_after_update($data, $memberInfo, &$args) {
if($data['comment'] <> '') {
sendmail(array(
'to' => '[email protected]',
'name' => 'Tester',
'subject' => 'A comment added to project',
'message' => 'Hi, there is a new comment<br>Comment : ' . $data['comment'] . '<br>Project No : ' . $data[project_no]
));
};
}
return TRUE;
}
How can i do that?
Best Regards.