Hello,
i have written a meeting formular. You can create some time slots. I want to save the time slots as separate entries in the database. I dont have any idea how to use the save function from cakePHP for formulars with other names. Therefore I used a SQL Statement, but with a SQL Statement I cant get the insert ID. Do you have any idea, for a better solution.
if($termine[‘addmore’][$counter] != “”) {
$DBTerminInsert = $connection->insert(‘termine’, [
‘termin_sitzungID’ => $this->request->session()->read(‘id’),
‘termin_startDate’ => $termine[‘addmore’][$i],
‘termin_startTime’ => $termine[‘addmore’][$counter2],
‘termin_endDate’ => $termine[‘addmore’][$counter1],
‘termin_endTime’ => $termine[‘addmore’][$counter3],
‘termin_art’ => 1]);
Data input from formular:
Array ( [addmore] => Array ( [0] => 2018-02-06 [1] => 2018-02-06 [2] => 15:40 [3] => 15:50 [4] => 2018-02-14 [5] => 2018-02-16 [6] => 17:30 [7] => 14:30 [8] => 2018-02-06 [9] => [10] => 19:50 [11] => [12] => 2018-02-02 [13] => 2018-02-13 [14] => 13:30 [15] => 18:50 [16] => [17] => [18] => [19] => ) [location] => Array ( [0] => [1] => somewhere ) )
Thanks for your help