Welcome Guest, Not a member yet? Register   Sign In
Store multiple values from select field in DB
#1

[eluser]heaversm[/eluser]
I've got an HTML form which allows a user to select multiple options in a dropdown. I then pass that data on as post data to a CI model. How do I store the multiple values in CI? This is my current code (which only stores the last of the multiple selected values:

Code:
function edit_member()
{
    if (isset($_POST['submit'])) {
        $v_id = $this->input->post('edit_id');
        //$v_memberdep = $this->input->post('sel_dep'); //ONLY STORES ONE VALUE
    }

$data = array(
    'member_dep' => $v_memberdep
);

$this->db->where('id', $v_id);
$this->db->update('members', $data);

}


Messages In This Thread
Store multiple values from select field in DB - by El Forum - 06-06-2011, 09:06 AM
Store multiple values from select field in DB - by El Forum - 06-06-2011, 11:39 AM
Store multiple values from select field in DB - by El Forum - 06-06-2011, 12:32 PM
Store multiple values from select field in DB - by El Forum - 06-06-2011, 01:20 PM
Store multiple values from select field in DB - by El Forum - 06-06-2011, 02:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB