dimoss
Well-Known Member
Hi,
The following thread gives a solution when someone wants to insert data from repeat group into another table using the PHP form plugin:
http://fabrikar.com/forums/index.ph...rom-repeating-group-into-another-table.48826/
However the above refers to non-array elements. What if there is an element in the repeated group which is dbjoin (single select)?
I use the following and insert the record(-s) ok but obviously returns only the first occurence of the dbjoin element array:
The 'fab_list_able_29_repeat___doubles' is the dbjoin element on the repeated group.
Any help?
Thanks.
The following thread gives a solution when someone wants to insert data from repeat group into another table using the PHP form plugin:
http://fabrikar.com/forums/index.ph...rom-repeating-group-into-another-table.48826/
However the above refers to non-array elements. What if there is an element in the repeated group which is dbjoin (single select)?
I use the following and insert the record(-s) ok but obviously returns only the first occurence of the dbjoin element array:
PHP:
$db = JFactory::getDBO();
$query = $db->getQuery(true);
foreach ($this->data['fab_list_able_29_repeat___id'] as $key => $value)
{
$query->clear()
->insert('fab_doubles')
->set('event = ' . $db->quote($this->data[fab_list_able_29_repeat___doubles_raw][0][$key]))
->set('assoc_a = ' . $db->quote($this->data[fab_list_able_29_repeat___assoc_raw][$key]))
->set('tournament = ' . $db->quote($this->data[fab_list_able_29_repeat___tournament_raw][$key]))
->set('player_a = ' . $db->quote($this->data[fab_list_able_29_repeat___player_id_raw][$key]));
$db->setQuery($query);
$db->execute();
}
The 'fab_list_able_29_repeat___doubles' is the dbjoin element on the repeated group.
Any help?
Thanks.
Last edited: