CodeIgniter Forums
Updating and creating text input with one submit.. how do I do this? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Updating and creating text input with one submit.. how do I do this? (/showthread.php?tid=54246)



Updating and creating text input with one submit.. how do I do this? - El Forum - 08-29-2012

[eluser]puffnstuff[/eluser]
-


I have a loop displays multiple inputs and one submit. How do I get it so where each item that is updated gets entered in the correct field?



Updating and creating text input with one submit.. how do I do this? - El Forum - 08-29-2012

[eluser]michalsn[/eluser]
In model use:
Code:
$this->db->where('id',$id);
$this->db->update('skills', $data);
or:
Code:
$this->db->update('skills', $data, array('id' => $id));

User guide is your friend: http://ellislab.com/codeigniter/user-guide/database/active_record.html#update


Updating and creating text input with one submit.. how do I do this? - El Forum - 08-30-2012

[eluser]puffnstuff[/eluser]
[quote author="michalsn" date="1346309852"]In model use:
Code:
$this->db->where('id',$id);
$this->db->update('skills', $data);
or:
Code:
$this->db->update('skills', $data, array('id' => $id));

User guide is your friend: http://ellislab.com/codeigniter/user-guide/database/active_record.html#update[/quote]

Still not updating


Updating and creating text input with one submit.. how do I do this? - El Forum - 08-30-2012

[eluser]puffnstuff[/eluser]
What I ended up doing was echoing the id for the name of each input. Works now.