Hi,
I'm been trying to store a set of objects in an array so i can return the array function call and ideally retrieve the objects from the array later on.
while ($row = mysql_fetch_assoc ( $queryResponse ) ) {
//create the annoymous objecct
$anObject = new WebSiteLink() ;
//load it up with values -- these are just some, so you can see...
$anObject->setName ( $name ) ;
$linkArray[$counter] = $anObject ;
$counter++ ; }
that is what i'm doing to load up the array. I've also tried using :
$linkArray[$counter] = &$anObject ;
but that doesn't work either. It compiles.. just doesn't do anything.
I'm not sure if the problem is up there, or down here... where i'm trying to get stuff out of the array. this code is right after the above code:
for ( $counter = 0 ; $counter < count( $linkArray ) ; $counter++ ) {
$anObject = $linkArray[$counter] ;
echo $anObject->getName() ;
}