[eluser]chefnelone[/eluser]
Hello
I'm having somme problem when I try to get a value from an array.
If I run these lines in my view:
Code:
<?php
print_r($images); <!-- JUST TO CHECK THAT THE ARRAY IS THERE -->
?>
<?php
foreach($images as $image){
echo $image->image_name; <!-- THIS IS LINE 26 -->
}
?>
I get this in the browser:
Code:
Array ( [images] => Array ( [0] => stdClass Object ( [id_product_image] => 1 [id_product] => 13 [image_name] => mesa-servida.jpg [product_image_title] => [product_image_descripription] => [orden] => 0 ) ) )
____________________________________________________________________
A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: includes/editor_producto_fotos.php
Line Number: 26
____________________________________________________________________
I can see tha the array is there but it fail when trying to get the value using: $image->image_name;
How do I get the values from the array?