[eluser]octavianmh[/eluser]
Hey guys, thanks in advance.
So I'm kindof beating my head against a wall on this, and think the answer is probably 2.5 minutes of time for the experts. sooo, here goes.
I have a model, which returns multiple rows of data, like this:
Code:
function getUserServiceInfoByUser($email)
{
$sql = "SELECT * FROM service, service_types, users, commands WHERE users.user_email = ? AND service.user_id = users.user_id AND service_types.service_type_id = service.service_type_id AND commands.commands_id = service.commands_id";
$query = $this->db->query($sql, array($email));
return $query->result();
}
Simple enough.
My controller grabs this info:
Code:
function index() {
$this->load->model('Usermodel','user', TRUE);
if($this->session->userdata('logged_in')) {
$data = array('serviceData' => $this->user->getUserServiceInfoByUser($this->session->userdata('user_email')) );
$this->load->view('view_services', $data);
}
}
Now above.. I'm not entirely sure if that's the way to properly drop this type of data, essentially a multidimensional array, in to the view...
Then my view, which fails with an error:
Code:
<?php
echo $service_type_name;
?>
I've also tried things like:
Code:
<?php
echo $serviceData['service_type_name'];
?>
To no avail. The data is being retrieved from the model correctly, I just don't know where to go from here to dump it out in my view!
Sigh!