2013-05-20 10 views
0

MySQL 데이터베이스에서 데이터를 검색 할 수있는 모바일 앱을 만들기 위해 PHP, JSON 및 Android와 함께 작업하고 있습니다. 데이터베이스에서 모든 데이터를 가져올 수 있지만 사용자 입력을 기반으로 특정 데이터를 가져 오려고하면 데이터를 가져올 수 없습니다. 나는 구글을 통해 해결책을 발견하려고 노력했지만 그것을 해결할 수는 없다. 이건 내 PHP 코드 http://pastebin.com/dbUr5DZj JSONParser 클래스 http://pastebin.com/FYXsWyr4 특정 클래스가 http://pastebin.com/UkSdh3BN데이터 파싱 오류 org.json.JSONException

어떤 도움에 감사 할 것입니다

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} 

: 나는 로그 캣에서 다음 오류가 발생했습니다. 감사.

+0

는 브라우저에서 웹 서비스를로드하고 응답을 확인합니다. JSON 형식의 응답을 받고 있습니까? –

답변

1

PHP 파일의 29 행에 오류가 있습니다. 라인 :

$respone["mahasiswa"] = array(); 

이되어야한다 :

$response["mahasiswa"] = array(); 
+0

정말 고마워, 나는 그런 작은 일에 관심을 기울이지 않았다. –