Hello. I have a form that contains a set detail. Each set may contain multiple items in it. For example:
SET01 contains ITEM01, ITEM02. I have no problem inserting new sets and this is the script that I use to insert new sets:
$data = array();
foreach($values['item'] as $item) {
$tempdata = array(
'id' => null,
'code' => strtoupper($values['code']),
'name' => strtoupper($values['name']),
'disc_id' => $values['discipline'],
'item_id' => $item,
'type' => $values['type']
);
array_push($data, $tempdata);
}
$this->db->insert_batch('tblsets', $data);
When I do an update to an existing set record, I can add new items to the set and remove any of the items as well. How do I do the update statement. I tried update_batch but it doesn't seem to work. Appreciate if someone could help me with this.
Thanks