Fatal error: Call to a member function on a non-object...
Posted: Sun Aug 19, 2007 8:49 pm
I have a piece of php code that looks like this:
In an earlier area, an XML loader object ($doc) is created. It pulls data from an XML file. The above loop is nested inside another one which spits out sectrions, this one spits out menu items. The data loads nicely, but then I get an error:
Thanks
Code: Select all
for($j = 0; $j < $itemCount; $j++){
$item = $doc->menu->section[$i]->item[$j]->attributes();
$itemText = $item['text'];
$itemHref = $item['href'];
$itemTarget = $item['target'];
echo '<a target='.$itemTarget.' href='.$itemHref.'>'.$itemText.'</a></br>';
};I have been reading about this error and most stuff talks about scope for variables and the like. THe part I don't get is that all the data roks fine, THEN I get the error. I would have thought that I would see nothing. Can some one please tell me what I am missing here.Fatal error: Call to a member function on a non-object...
Thanks