PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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:
Fatal error: Call to a member function on a non-object...
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.
Thanks
Yes, I am instantiating the XML loader object as $doc, in an earlier area. It runs the code correctly until the llop finishes, then the error is echoed. That's the puzzling part, it all works until the last moment...
Ahhh!! I forgot to reset my $itemCount variable at the end of the second for loop, immediately after the echo '</p>'; line. Works perfect now! Thanks all.