Welcome Guest, Not a member yet? Register   Sign In
Passing data from controller to model in an array. Please help!
#2

[eluser]rwestergren[/eluser]
Have you already loaded the model?
Code:
$this->load->model('items_model');

Post uses the input class, so you'll need to use:
Code:
$result = $this->items_model->add( array(
        
        'ite_owner' => $this->input->post('user'),  
        'ite_type' => $this->input->post('type'),
        'ite_value_1' => $this->input->post('value_1'),
        'ite_value_2' => $this->input->post('value_2'),
        'ite_value_3' => $this->input->post('value_3'),
        'ite_value_4' => $this->input->post('value_4'),
        'ite_value_5' => $this->input->post('value_5'),
        'ite_access' => $this->input->post('access')
        
        ));

You then have a function in the model that accepts the array and processes it from there.


Messages In This Thread
Passing data from controller to model in an array. Please help! - by El Forum - 07-24-2010, 09:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB