I have a json object like like this
[
[
{
"class":"com.ehealth.data.Sample_Data",
"collectedBy":"2013-07-21",
"collectedDate":"Kamal",
"orderID":2,
"sampleID":2.897033553E9
},
{
"class":"com.ehealth.data.Order_Data",
"doctorUsername":"Kamal",
"dueDate":"2014-01-02",
"orderDate":"2013-12-12",
"orderID":2,
"patientID":"P0001",
"prority":1,
"status":"complete",
"testType":"Fasting Blood Sugar"
}
],
[
{
"class":"com.ehealth.data.Sample_Data",
"collectedBy":"2013-07-22",
"collectedDate":"Kamal",
"orderID":3,
"sampleID":5.978956192E9
},
{
"class":"com.ehealth.data.Order_Data",
"doctorUsername":"Kamal",
"dueDate":"2014-01-02",
"orderDate":"2013-12-12",
"orderID":3,
"patientID":"P0001",
"prority":2,
"status":"complete",
"testType":"Fasting Blood Sugar"
}
]
]
and i decode it to php array
$data['query'] = json_decode($curl_response);
i try to access valuse like this
foreach ($query as $row) {
echo $row->sampleID;
}
but when i am going to access the the values inside it i can not access i get a error
A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
can anybody help me. i dont know what to do