doAfterProcessing - Insert TWO Tables

Hello,

I am trying to use the doAfterProcessing to INSERT data into one table after an INSERT from the grid on another table.

function myUpdate($after) {
     $server_id = $after->get_new_id();
     $after->render_sql("INSERT INTO fake_table (server_id,person_id) VALUES ($server_id,".$_GET['id'].")","person_to_server_id","server_id,person_id");
}

$grid->event->attach("doAfterProcessing","myUpdate"); 

The Insert to the first table, connected from the gird works, but the above event->attach doesn’t fire off.

What am I doing wrong? Thanks!

RESOLVED

function myIUpdate($action) { global $grid; $server_id = $action->get_value("server_id"); $grid->sql->query("INSERT INTO fake_table (server_id,person_id) VALUES ($server_id,".$_GET['id'].")"); } $grid->event->attach("afterProcessing", "myUpdate");