Update data in other table
Update data in other table
misteam
Posts: 50Questions: 18Answers: 0
Is there any function like this for update ?
function logChange ( $db, $id) {
$date = new DateTime();
$db->insert( 'transactions_history', array(
'user_id' => $user_id,
'values_log' => $values,
'transaction_id' => $id,
'date_log' => $date->format("m-d-Y")
) );
}
->on( 'postEdit', function ($editor, $id, $row) {
logChange( $editor->db(),$id);
} )
Thank you in advance!
This discussion has been closed.
Answers
Yep, that's an example on this manual page that's almost exactly the same as that. Hopefully that'll get you going,
Colin
Hi Sir @colin,
I think the sample would be at the same table not on an update to another table.
Thanks
The first parameter passed into the
$db->insert()
method is the database table that the insert will operate on. You can modify that as you need.Allan