Multiselect form field options not selected in CodeIgniter view after updating database tables
02:42 03 Nov 2015

I am trying to get multiple inputs from a dropdown list but its returning a no value.

Here is my code:

controller:

public function mark_error($id = null, $email = null)
{
    if ($this->userlib->isLoggedIn())
    {
        if ($this->userlib->isAdmin())
        {
            $seller_error = $this->input->post('seller_error');
            if (is_null($seller_error))
            {
                $seller_error = array();
            }
            $marked_error_seller = implode(',', $seller_error);

            $bank_error = $this->input->post('bank_error');
            if (is_null($bank_error))
            {
                $bank_error = array();
            }
            $marked_error_bank = implode(',', $bank_error);

            $store_error = $this->input->post('store_error');
            if(is_null($store_error))
            {
                $store_error = array();
            }
            $marked_error_store = implode(',', $store_error);

            $id2 = $this->userlib->getId();
            $data['admin_data'] = $this->admin_panel_model->admin_data($id2);

            $data['marked_error_seller'] = $marked_error_seller;
            $data['marked_error_store'] = $marked_error_store;
            $data['marked_error_bank'] = $marked_error_bank;
            $data['email'] = $email;

            $this->admin_panel_model->mark_error_seller($id, $marked_error_seller);
            $this->admin_panel_model->mark_error_bank($id, $marked_error_bank);
            $this->admin_panel_model->mark_error_store($id, $marked_error_store);                               
            $this->load->view('send_mail', $data);
        } else {
            echo "User not Allowed";
        }
    } else {
        echo "User not Logged In";
    }
}

model:

public function mark_error_seller($id, $marked_error_seller)
{
    $data = array('marked_error_seller' => $marked_error_seller, 'seller_status' => 2);
    $this->db->update($this->seller_table, $data, array('id' => $id));
    $status = array('error_status' => 1, 'admin_check' => 8);
    $this->db->update($this->table, $status, array('id' => $id));
}

public function mark_error_bank($id, $marked_error_bank)
{
    $data1 = array('marked_error_bank' => $marked_error_bank, 'bank_status' => 2);
    $this->db->update($this->bank_table, $data1, array('id' => $id));
    $status = array('error_status' => 1, 'admin_check' => 8);
    $this->db->update($this->table, $status, array('id' => $id));   
}

public function mark_error_store($id, $marked_error_store)
{
    $data2 = array('marked_error_store'=>$marked_error_store, 'store_status' => 2);
    $this->db->update($this->store_table, $data2, array('id' => $id));
    $status = array('error_status' => 1, 'admin_check' => 8);
    $this->db->update($this->table, $status, array('id' => $id));
}

view:

 

To elaborate,the status is successfully changed in the database, but the inputs from the three dropdown list are not being updated.

php codeigniter model-view-controller multi-select selected