Hello Abu,
what is the correct syntax (if is possible) to pass a variable to a function with on_insert or on_update?
I tried this for example:
$e[“on_insert”] = array(“my_insert_function($_SESSION[myvalue])”, null, true);
function my_insert_function(&$data, $myvalue)
{
$data[“params”][“log_myvalue”] = $myvalue;
}
But I only get a 500 Internal server error
Thanks
1 Answers
Hello,
The event callbacks default receives required data as param.
http://phpgrid.org/docs/grid-events/
If you want to use $_SESSION in function, you can always use it as it is super global.
function my_insert_function(&$data)
{
$data[“params”][“log_myvalue”] = $_SESSION[“myval”];
}
Your Answer