I have a php file for my android project. I want it to show the array data from my php codes. but it show the error like "error parsing data org.json.JSONException ... error org.json.JSONObject cannot be converted to JSONArray"
Here's the php codes :
$rows = array();
$rows['nama_makanan'] = "you have yet to input";
$rows['Jtakaran'] = "-";
$data = "{food:".json_encode($rows)."}";
echo $data;
I'm guessing the error is in the php code. because when I try to retrieve data from mysql the program is working fine. I'm sorry for my bad English . Any help would be appreciated, thank you
ps : I want the data to retrieve as JSONArray because this is for expanadablelistview.