How to Insert from selectMulti field
- kevin.waterson@gmail.com
- Member | 81
How best to insert data from
<?php
$form->addMultiSelect('my_field', 'My Label:', $my_var)
->setRequired('My Label is required.');
?>
Doing a foreach seems a bit crude.
How is this handled in nette?
<?php
foreach( $values->my_field as $my_id){
$db->table('my_table')->insert($other_id, $my_id);
}
?>
- kevin.waterson@gmail.com
- Member | 81
Pavel Kravčík wrote:
What about multi-insert?
https://doc.nette.org/…ase/explorer#…
This would still require a foreach loop, to create the values.