I want to achieve a result where I update any values at 'table1', this update will be reflected on 'table2' which share the same column name and value.
e.g I update 'table1' which has column name "Jan" that contains value "30". 'Table2' is also has column name "Jan" that contains value "10". Upon updating "Table1", the same update will go to "Table2" on column "Jan" which being changed/updated to value "30" .
Which features in phpgrid shall I use ?
I really need help from someone here.
Thanks.
I am showing a sample usage code.
If you wish to update table2 when updating table1.
For the grid that is referring table1,
you can add update event handler that will update table2 data (along with it's update query)
// config for table 1 grid
$e["on_update"] = array("update_data", null, true);
$grid->set_events($e);
function update_client($data)
{
$str = "UPDATE table2 SET Jan='{$data["params"]["Jan"]}' WHERE client_id = {$data["client_id"]}";
mysql_query($str);
}
For more details, refer demos/editing/custom-events.php