[eluser]gtech[/eluser]
in your example your passing an array called data to your view, with the key vehicles. you can pass other keys as well for example buildings;
Code:
$data['vehicles'] = $this->mdl_vehicle->get_all_records();
$data['buildings'] = $this->mdl_buildings->get_all_buildings();
$this->load->view->('viewname',$data);
in the view, the keys of the $data array become the extracted variables.
so
$vehicles will be the the result_array from get_all_vehicles();
$buildings will be the result_array from get_all_buildings();
so to access your keys you will have to do somthing like this in your veiw;
Code:
<?php foreach($vehicles as $row):?>
<?=$row['Make'];?>
<?php endforeach;?>
<?php foreach($buildings as $row):?>
<?=$row['Name'];?>
<?php endforeach;?>
this is because result_array() can return more than one row eg.
Code:
<?php
echo $vehicles[0]['Make'];
echo $vehicles[0]['Year'];
echo $vehicles[1]['Make'];
?>
if you only want to return one row from the database use row_array() instead, then you access Make as follows in your view
Code:
echo $vehicles['Make'];