[eluser]PHP Creative[/eluser]
Hi there
I was wondering if anybody could point me in the right direction to update Multiple rows in Codigniter. Just a link or explanation of what to do?
View >>>
Code:
<? echo form_open("".current_url().""); ?>
<table>
<thead>
<th>ID</th>
<th>First Name</th>
<th>Surname</th>
</thead>
<?php foreach ($query->result() as $row){ ?>
<tr>
<td><? echo $row->ID; ?><? echo form_hidden('ID[]',$row->ID); ?></td>
<td><? echo form_input('FirstName[]',$row->FirstName); ?></td>
<td><? echo form_input('Surname[]',$row->Surname); ?></td>
</tr>
<? } ?>
</table>
<? echo form_submit('Update', 'Edit'); ?>
<? echo form_close() ?>
Bit stuck on what to do next. Got the post array but it doesn't make any sense (keys etc). Any help would be kindly appreciated.
Controller >>
Code:
function Update() {
print_r($_POST);
}
Thanks a million!