I'm trying to input multiple select values in Database. Here is my demo code:
https://jsfiddle.net/wuarv946/
My controller:
public function create()
{
$data= array(
'name' => $this->input->post('name'),
'foods' => $this->input->post('foods')
);
$this->food_model->add_food($data);
}
My model:
public function add_food($data)
{
$this->db->insert('order_items', $data);
}
It only insert the last value of select. How to fix that.