I'm working with PHP, JSON, and Android to create mobile app that can retrieve data from MySQL database. I'm able to get all data from database but, when I try to get a specific data based on the user input I'm unable to get the data. I've try to discovered the solution through the google but I can't solve it. I got the following error from the logcat :
05-20 08:44:28.152: E/JSON Parser(313): Error parsing data org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject<br />
05-20 08:44:28.152: E/JSON Parser(313): <b>Warning</b>: array_push() expects parameter 1 to be array, null given in <b>C:\xampp\htdocs\android\getSpesificName.php</b> on line <b>31</b><br />
05-20 08:44:28.152: E/JSON Parser(313): {"success":1,"mahasiswa":null}
05-20 08:44:28.152: D/Specific name(313): {"mahasiswa":[{"nama_mhs":"kurnianto"},{"nama_mhs":"amjad"},{"nama_mhs":"oki"},{"nama_mhs":"tes"},{"nama_mhs":"coba"},{"nama_mhs":"raditya"},{"nama_mhs":"edwin"}],"success":1}
This is my PHP code http://pastebin.com/dbUr5DZj JSONParser class http://pastebin.com/FYXsWyr4 Specific class http://pastebin.com/UkSdh3BN
Any help will be appreciate. Thanks.