Welcome Guest, Not a member yet? Register   Sign In
Multiple row update
#1

[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>
    &lt;?php foreach ($query->result() as $row){ ?&gt;
    <tr>
        <td>&lt;? echo $row->ID; ?&gt;&lt;? echo form_hidden('ID[]',$row->ID); ?&gt;</td>
        <td>&lt;? echo form_input('FirstName[]',$row->FirstName); ?&gt;</td>
        <td>&lt;? echo form_input('Surname[]',$row->Surname); ?&gt;</td>
    </tr>
    &lt;? } ?&gt;
</table>
&lt;? echo form_submit('Update', 'Edit'); ?&gt;

&lt;? echo form_close() ?&gt;


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!


Messages In This Thread
Multiple row update - by El Forum - 01-23-2011, 03:45 PM
Multiple row update - by El Forum - 01-23-2011, 04:18 PM
Multiple row update - by El Forum - 01-23-2011, 08:50 PM
Multiple row update - by El Forum - 01-24-2011, 02:30 PM
Multiple row update - by El Forum - 01-24-2011, 04:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB