Welcome Guest, Not a member yet? Register   Sign In
[SOLVED]Giant CI noob here - I can't get the data I get from the database to work with my View?
#5

[eluser]TWP Marketing[/eluser]
[quote author="timtamboy63" date="1309248251"]That makes a lot of sense, thanks.

I tried
Code:
foreach( $q->result() as $project)

   $data[] = $project; // load the data array with project objects
  }

But I couldn't access the $project object from my view, for obvious reasons.

I'll give it a go now, cheers[/quote]

You would need to add an array name within the data array:
Code:
foreach( $q->result() as $project)

   $data['projects'][] = $project; // load the data array with project objects
  }
Then reference the exploded array as objects: $projects


Messages In This Thread
[SOLVED]Giant CI noob here - I can't get the data I get from the database to work with my View? - by El Forum - 06-28-2011, 10:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB