CodeIgniter Forums
how is deleting multiple rows from mysql with checkbox? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: how is deleting multiple rows from mysql with checkbox? (/showthread.php?tid=42036)



how is deleting multiple rows from mysql with checkbox? - El Forum - 05-24-2011

[eluser]SaSa[/eluser]
hello
how is deleting multiple rows from mysql with checkbox?


how is deleting multiple rows from mysql with checkbox? - El Forum - 05-24-2011

[eluser]Frank Rocco[/eluser]
Code:
In View
echo form_checkbox('delete[]',$row->id,true);

Code:
In Controller
$delete = $this->input->post('delete');
for($i=0;$i<count($delete);$i++) {
$this->db->where('id', $delete[$i]);
$this->db->delete('searchlog');
}



how is deleting multiple rows from mysql with checkbox? - El Forum - 05-26-2011

[eluser]SaSa[/eluser]
not work. why?


how is deleting multiple rows from mysql with checkbox? - El Forum - 05-26-2011

[eluser]Frank Rocco[/eluser]
Let's see your code and database layout


how is deleting multiple rows from mysql with checkbox? - El Forum - 03-15-2012

[eluser]Ali Fattahi[/eluser]
The Codes of Frank Rocco are correct . please put the result of the blow code after submit your form
Code:
echo '<pre>';
print_r($_POST);



how is deleting multiple rows from mysql with checkbox? - El Forum - 03-15-2012

[eluser]InsiteFX[/eluser]
Next time how about posting in the correct forum topic this forum topic is users who have contributed code libraries. Not for asking general questions.