Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Update multiple inputs with the same name
#1

[eluser]puffnstuff[/eluser]
edit: got the answer for anybody who finds this I have updated with the correct way to update inputs with the same name in a loop...

Controller
Code:
$i=0;
foreach ($this->input->post('skill') as $cat)
{
    $this->db->where('id', $i)->update('skills', array('skill' => $cat));
    $i++;
}


Model
Code:
function update_record($data)
{

    $this->db->update('skills', $data);
   }

View

Quote:<input type="text" name="skill[]">



Messages In This Thread
[SOLVED] Update multiple inputs with the same name - by El Forum - 08-30-2012, 07:43 AM
[SOLVED] Update multiple inputs with the same name - by El Forum - 08-30-2012, 08:23 AM
[SOLVED] Update multiple inputs with the same name - by El Forum - 08-30-2012, 01:53 PM
[SOLVED] Update multiple inputs with the same name - by El Forum - 08-30-2012, 02:04 PM
[SOLVED] Update multiple inputs with the same name - by El Forum - 08-30-2012, 02:24 PM
[SOLVED] Update multiple inputs with the same name - by El Forum - 08-30-2012, 02:26 PM
[SOLVED] Update multiple inputs with the same name - by El Forum - 08-30-2012, 03:23 PM
[SOLVED] Update multiple inputs with the same name - by El Forum - 08-30-2012, 04:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB