Welcome Guest, Not a member yet? Register   Sign In
CI Objects and arrays - aaghh!
#1

[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.


Messages In This Thread
CI Objects and arrays - aaghh! - by El Forum - 06-30-2010, 08:50 AM
CI Objects and arrays - aaghh! - by El Forum - 06-30-2010, 09:41 AM
CI Objects and arrays - aaghh! - by El Forum - 06-30-2010, 10:03 AM
CI Objects and arrays - aaghh! - by El Forum - 06-30-2010, 10:11 AM
CI Objects and arrays - aaghh! - by El Forum - 06-30-2010, 10:13 AM
CI Objects and arrays - aaghh! - by El Forum - 07-01-2010, 02:17 AM
CI Objects and arrays - aaghh! - by El Forum - 07-01-2010, 03:04 AM
CI Objects and arrays - aaghh! - by El Forum - 07-01-2010, 04:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB