Skip to content Skip to sidebar Skip to footer

Codeigniter:: Deleting Multiple Records In Checkbox

I can't seem to find what is wrong with my code. I want to be able to delete records which have been checked in a table. This is my VIEW:

Solution 1:

You should use a foreach loop to delete. In the Controller:

public function remove_category()
{

    $checked = $this->input->post('delete');
    foreach($checked as $val){
        $this->category_model->delete_category($val);
    }
    redirect('category/read_category');

}

Post a Comment for "Codeigniter:: Deleting Multiple Records In Checkbox"