I'm trying to get data from sql query using Joomla api, when I loop through results returning from query using for each I tried to access the object properties using this:
$opt->id
I got nothing now I tried to var_dump the variable $opt and got the following
object(stdClass)[172] public 'id' => string '1' (length=1) public 'name' => string '2011' (length=4)
How could I access the id and name property of this object.
Thanks
Try using get_object_vars(); http://us3.php.net/manual/en/function.get-object-vars.php
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.