[eluser]Luke D.[/eluser]
Hi all -
I am returning some data from a model to a controller - this is all pretty straightforwards - and I have coded stuff like this hundreds of times albeit not in CI, and this chunk of code keeps getting "Message: Undefined index: name."
The code is like this:
Code:
if($id=='root')
{
$results = $this->Visitor->get_all_type($type, 'web01');
foreach($results as $result) {
$item[]['text']=$result['name'];
}
} else {
//blah blah...
}
$this->Visitor is a model accessing the database and that is working fine. In fact, the code is producing data, but there is this warning message and I don't see how $result['name'] could be unassigned. Heck, when I print_r($result['name'] it prints out the array but I still get the warning. How is this possible?
Luke