I am trying to read through an array in the same way I do many other times on my site. This one is giving me the Fatal error: Cannot use object of type stdClass as array. In my class I have:
public $productlist = array();
//GetFeatured
while($obj = $result->fetch_object()){
$this->productlist[] = $obj;
}
In my page I am trying to display it:
$prod = new product;
$prod->GetFeatured();
for($ind = 0; $ind <= count($prod->productlist) - 1; $ind++){
echo $prod->productlist[$ind]['productid'];
}
This populates the array but I am not sure why I am getting this error. Any help is greatly appreciated.