public function update_order_categories() { $categories = $this->input->post('categories'); $array_cat = explode(',', $categories); $order = 1; foreach ($array_cat as $category) { Category::change_orders_categories($category, $order); $order++; } }