pass many same values to model - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: pass many same values to model (/showthread.php?tid=69015) |
pass many same values to model - Ali - 09-27-2017 Hello CI members i need your help. first get all records in date column and display in view, After submit all date data pass to controller, they will be stored as Unix format. i do't know how to handle they values to model. please check my source VIEW: PHP Code: <form method="post" action="convert_date_script/convert_do"> PHP Code: public function convert_do(){ RE: pass many same values to model - rtenny - 09-27-2017 In your case each input field has the same name. They are either called data_id or id. You need to create a input arrays Try this <input type="text" value="<?php echo $start_date; ?>" name="date_<?php echo $id; ?>[]"> <input type="hidden" value=<?php echo $id; ?> name="id[]"> RE: pass many same values to model - Ali - 09-27-2017 (09-27-2017, 08:39 AM)rtenny Wrote: In your case each input field has the same name. They are either called data_id or id. You need to create a input arrays uh it's too good. then what code needs in controller ? date_$id return 0 $start_date = $this->input->post("date_$id"); for($i=0; $i<count($start_date);$i++){ $count++; } |