[eluser]pfreitas[/eluser]
I've a
employees,
services and a
employees_services table where I store the services one employee execute with their id and service id. I'm having trouble to save/update the services one employee execute...
Code:
// ...
$employee = new Employee;
$employee->from_array($this->input->post(null, true), array(
// ... fields ...
));
$service = new Service;
->select('id')
->where_in('id', $this->input->post('services')) // ids from select-box
->get();
$employee->save(array('service' => $service->all));
This code is saving services, but if I try to deselect any option, it doesn't get deleted... I don't know where I'm doing wrong, what I've to do to insert/delete services based on select-box selection?
Thank you in advance!