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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.