I want to delete "several row mysql database" together after select with checkbox in "codeigniter", but my function not work:(my problem is in "function delete()"). What is it?
function delete(){
$delete = $this->input->post('delete'); // this is array => "delete[]" . value this is "id" it row in database.
for($i=0;$i<count($delete);$i++) {
$this->db->delete('My_Table', array('id' => $delete[$i]));
}
}
print_r($delete);before the for loop? Does it contain what you think it should?