Welcome Guest, Not a member yet? Register   Sign In
how is deleting multiple rows from mysql with checkbox?
#1

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

[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');
}
#3

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

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

[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);
#6

[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.




Theme © iAndrew 2016 - Forum software by © MyBB