I am trying to use bulk insert in phpgrid, and want to insert the selected values using multiselect feature. Then each selected will be inserted.
It's inserting just the first selected value in multiselect.
function on_insert($data)
global $g;
if ($data["params"]["bulk"] == "add-rows")
{
$rows = $data["params"]["data"];
for($i=0;$i<$rows;$i++)
$g->execute_query("INSERT INTO client (id,client_id) VALUES ('','')");
die;
}
}
The code works to insert blank rows, and it's necessary to insert values taken using multiselect feature, then at time would insert new rows.