[eluser]elmne[/eluser]
I'm trying to retrieve checkbox values from an array so that the checked id numbers in the array can be processed.
I do it like this
In the view, i declare the checkbox like this
Code:
<tr>
<td><input type="checkbox" name="checkbox[<?php echo $row->customer_type_id ?>]" value="<?php echo $row->customer_type_id ?>" /></td>
</tr>
Then when the form is submitted, i try to process it like this
Code:
$checked = $this->input->post('checkbox[]');
$checked = $this->input->post('checkbox[]');
$count = count($checked);
for($i=1; $i < $count; $i++)
Followed by the sql command that uses
as a parameter.
But it gives me an error. The sql command fails to work even though no error is shown.
What's wrong with the above code?