Jump to content

multiple update in CI


Yohanne

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.