[eluser]Bart Mebane[/eluser]
I think this may be what you're trying to do:
In the view ...
Code:
echo form_open();
foreach($items as $item)
{
echo form_input('last_name[' . $item->id . ']', $item->last_name);
}
echo form_submit('do','add');
echo form_close();
In the controller ...
Code:
if ($this->input->post('do'))
{
$last_name_array = $this->input->post('last_name');
foreach ($last_name_array as $id=>$value)
{
$this->model->update_last_name($id, $value);
}
}
Obviously this leaves out a lot of details, but the basic idea is to use an array for the name of the text fields, and use the id as the array index. If you want to have a separate submit button for each id, you can also use an array for the button name.