Yohanne Posted October 13, 2014 Share Posted October 13, 2014 Hi coders, im trying to update multiple rows of record using check-box and have a default value "RCV" and now im getting difficulties since im new in CI and any body can help and solve or can improve this code below. view <tr> <td><input type = "hidden" value = "<?php echo $row->pull_out_id ?>" name = "po_id"></td> <td><input type="checkbox" class="case" name="case" value="rcv"/></td> </tr> controller public function update_po_receive() { $po_id = $this->input->post('po_id'); $this->public_base_model->update_po_receive($po_id); redirect('public_base/search_stocks', 'refresh'); } model public function update_po_receive($po_id) { $data = array('temp' => $this->input->post('case')); $this->db->where('pull_out_id', $po_id); $this->db->update('pull_out', $data); } Link to comment https://forums.phpfreaks.com/topic/291605-multiple-update-in-ci/ Share on other sites More sharing options...
Yohanne Posted October 13, 2014 Author Share Posted October 13, 2014 code above is working, but somehow its working wrong with wrong rows update, and can update only one recored Link to comment https://forums.phpfreaks.com/topic/291605-multiple-update-in-ci/#findComment-1493442 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.