[eluser]forzaferrari87[/eluser]
Hallo,
currently I try to work with multidimensional arrays in CodeIgniter. Bigger problems I have if I want to update this mutli arrays. No problem I have if I insert multi arrays into the database.
That's my try for update of multi array.
Code:
foreach ($data as $key => $row)
{
$soid[$key] = $row['id'];
$data_n[$key] = array(
'showid' => $row['showid'],
'showday' => $row['showday'],
'showstart' => $row['showstart'],
'showend' => $row['showend'],
'showtime' => 0
);
$this->db->where('soid', $soid[$key]);
$this->db->update('televisionshow_onair', $data_n[$key]);
}
That's my solution if I want to insert arrays into database as comparison.
Code:
$data = array();
for ($i = 0; $i < 7; $i++) {
$data[$i] = array(
'soid' => NULL,
'showid' => $showid,
'showday' => $this->input->post('showday')[$i],
'showstart' => $this->input->post('showstart')[$i],
'showend' => $this->input->post('showend')[$i],
'showtime' => NULL
);
}