[eluser]Loquela[/eluser]
I think I'm missing the wood for the trees here.
I'm struggling with retrieving values for arrays and objects. Please help.
In my controller I have:
Code:
$data = array('upload_data' => $this->upload->data());
and I am able to list the upload_data using a loop:
Code:
foreach($upload_data as $item => $value):, etc, etc
This works fine.
But what I can't seem to do is capture $orig_name from the $upload_data variable for my model. I'm doing this:
controller:
Code:
$this->files_model->insert_file($data);
model:
Code:
function insert_file($data)
{
$this->db->insert('als_files', array('file_filename' => $upload_data['orig_name']));
}
I know this is wrong and opf course i get "Undefined variable: upload_data"
Could anyone help?
Many thanks in advance,
L.