marcelhavlik
Member
Hello, I need to insert data from repeating group into another table. I have to created a PHP plugin (onBeforeCalculations) and started with this code, but have an issue with arrays.
Code:
foreach ($this->data['fabrik_vyroba_47_repeat___id'] as $key) {
$query="INSERT into fabrik_vyroba_51_repeat (parent_id, vyroba_polozky_odvadeni_pozice, vyroba_polozky_odvadeni_polozka) values ('$id', '$this->data[fabrik_vyroba_47_repeat___vyroba_polozky_vypocet_pozice][$key]', '$this->data[fabrik_vyroba_47_repeat___vyroba_polozky_vypocet_np_delka][$key]')";
$db->setQuery($query);
$db->query();
}