I am getting this error Error: com.android.volley.ParseError:org.json.JSONExecption:End of input at 0 of

This is JSONObject in android java file

 public void getExecutiveInfo(){ String url = "https://sampleappdatabase.000webhostapp.com/SmartKids/ExecutiveInfo.php"; JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { Toast.makeText(getApplicationContext(),"Response :"+response,Toast.LENGTH_SHORT).show(); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { Toast.makeText(getApplicationContext(),error.toString(),Toast.LENGTH_SHORT).show(); } }){ @Override protected Map<String, String> getParams() throws AuthFailureError { Map<String,String> params = new HashMap<>(); params.put("UserId",UserId); return params; } }; Singleton.getInstance(getApplicationContext()).addToRequestque(jsonObjectRequest); } 
  This is my php file in the Server  
 <?php require "connect.php"; $userId = $_GET['UserId']; $query = "SELECT FirstName FROM `executive` WHERE ExecutiveId = '$userId'"; $result = mysqli_query($conn, $query); $response = array(); if(mysqli_num_rows($result)){ while($row = mysqli_fetch_assoc($result)){ $response['ExecutiveInfo'][] = $row; echo json_encode($response); } } mysqli_close($conn); ?>
  I am getting an Error while executing this project, Error is : Error: com.android.volley.ParseError:org.json.JSONExecption:End of input at 0 of I want to fetch the Executive Details Based on there User Id but i am getting Error, Help me to Solve this problem

Beginner Asked on May 7, 2018 in Software.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.