Welcome Guest, Not a member yet? Register   Sign In
undefined index error message
#1

[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


Messages In This Thread
undefined index error message - by El Forum - 09-02-2008, 08:14 PM
undefined index error message - by El Forum - 09-02-2008, 08:47 PM
undefined index error message - by El Forum - 09-03-2008, 07:50 AM
undefined index error message - by El Forum - 09-07-2008, 08:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB