![]() |
Multi-record form or tabular form with records from db tables - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Multi-record form or tabular form with records from db tables (/showthread.php?tid=42275) |
Multi-record form or tabular form with records from db tables - El Forum - 06-01-2011 [eluser]Unknown[/eluser] This seems like a very common requirement to me, and I am new to CI. I am trying to achieve this to be able to display multiple profiles for a user_id (tank auth) e.g. my model has: - Code: function Get_user_profiles($user_id) this will return multiple records for personal profile, company profile etc (this is as per my design). Note: I am able to implement the form for single record returned e.g. Code: if ($query->num_rows() == 1) return $query->row(); In controller I do something like : - Code: $data['profiles'] = ...Get_user_profiles($session_user_id); and later pass $data during view load. How can I build my form to handle multiple record. Is there some code generator/module or can someone help me with code snippets to create view file, and correctly form_validate the multi-record fields ? Another important thing is that I want to use this form to view as well edit the fields for all profiles. Thanks in advance. |