php - Delete several row together-array -
i want delete several row foreach
, have output bool(false) not array
following code. how fix it?
<input type="checkbox" name="checked[]" value="1"> function delete_test() { $delete = $this->input->post('checked'); if (is_array($delete) && count($delete) > 0) { foreach ($delete $val) { $this->db->query("delete hotel_units relation '$val'"); } var_dump($delete); echo "<br>is array"; } else { var_dump($delete); echo "<br>not array"; } // output is: bool(false) not array }
i can guess $this->input->post means, if checkbox called 'checked[]' need $post:
$this->input->post('checked[]');
Comments
Post a Comment