i am trying to iterate a result set using foreach loop. Below is my array when i do print_r on result set
Array
(
[0] => stdClass Object
(
[xml] =>
[qid] => 406
[title] => Q by Sikander
[description] => test question created by Sikander
)
)
Using following foreach loop
foreach ($xmls_nodes as $value){
echo $value->qid ;
echo $value->xml ;
echo $value->title ;
echo $value->description ;
}
now as a result it prints following
406 Q by Sikander test question created by Sikander
but right after this it also prints following for each of the record and row
A PHP Error was encountered Severity: Notice
Message: Trying to get property 'qid' of non-object
it give same line no in for error where i am printing these values and using die statement after this, please help me to get rid of this issue