title: why does my data not come out?
body: <pre><code>public class Config {
      public static final String DATA_URL = "http://192.168.1.2/retrieveone.php?id=";
      public static final String KEY_NAME = "BusinessName";
      public static final String KEY_AmountTotal = "AmountTotal";
      public static final String KEY_RT = "RequiredTotal";
      public static final String KEY_MT = "MaxTotal";
      public static final String JSON_ARRAY = "result";
  }
  </code></pre>
  
  <p>This is my class file . </p>
  
  <pre><code>  private void getData(){
          String id = TempItem.toString().trim();
          if (id.equals("")) {
              Toast.makeText(this, "Please enter an id", Toast.LENGTH_LONG).show();
              return;
          }
  
  
          String url = Config.DATA_URL+TempItem.toString().trim();
  
          StringRequest stringRequest = new StringRequest(Request.Method.GET,url, new Response.Listener&lt;String&gt;() {
              @Override
              public void onResponse(String response) {
  
                  showJSON(response);
              }
          },
                  new Response.ErrorListener() {
                      @Override
                      public void onErrorResponse(VolleyError error) {
                          Toast.makeText(KPDetails.this,error.toString(),Toast.LENGTH_LONG).show();
                          error.printStackTrace();
                      }
                  });
          int socketTimeout =50000;//5 seconds - change to what you want
          RetryPolicy policy = new DefaultRetryPolicy(socketTimeout, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
          stringRequest.setRetryPolicy(policy);
          RequestQueue requestQueue = Volley.newRequestQueue(this);
          requestQueue.add(stringRequest);
      }
   private void showJSON(String response){
          String name="";
          String AmountTotal="";
          String RequiredTotal = "";
          String MaxTotal = "";
          try {
              JSONObject jsonObject = new JSONObject(response);
              JSONArray result = jsonObject.getJSONArray(Config.JSON_ARRAY);
              JSONObject stallsData = result.getJSONObject(0);
              name = stallsData.getString(Config.KEY_NAME);
              AmountTotal = stallsData.getString(Config.KEY_AmountTotal);
              MaxTotal = stallsData.getString(Config.KEY_MT);
              RequiredTotal = stallsData.getString(Config.KEY_RT);
          } catch (JSONException e) {
              e.printStackTrace();
          }
          Stall.setText("Name:\t"+name+"\nAmountTotal:\t" +AmountTotal+ "\nMaxTotal:\t"+ MaxTotal);
      }
  </code></pre>
  
  <p>This is my constructor to get data from mysql daatabase. However, I managed to get the setText but not the value of the strings in config.</p>
  
  <p>This is my php file.</p>
  
  <pre><code>?php 
  
  
  if($_SERVER['REQUEST_METHOD']=='GET'){
  
   $id  = $_GET['id'];
  
   require_once('conn.php');
  
   $sql = "SELECT * FROM business WHERE BusinessID='".$id."'";
  
   $r = mysqli_query($conn,$sql);
  
   $res = mysqli_fetch_array($r);
  
   $result = array();
  
   array_push($result,array(
   "BusinessName"=&gt;$res['BusinessName'],
   "AmountTotal"=&gt;$res['AmountTotal'],
   "RequiredTotal"=&gt;$res['RequiredTotal'],
  "MaxTotal"=&gt;$res['MaxTotal']
   )
   );
  
   echo json_encode(array("result"=&gt;$result));
  
   mysqli_close($conn);
  
  }
  </code></pre>
  
  <p>"<a href="http://localhost/retrieveone.php?id=1" rel="nofollow noreferrer">http://localhost/retrieveone.php?id=1</a>" works perfectly fine but the value just does not show up in my setText.
  I am a beginner in Android Studio. Any help is appreciated. Thanks in advance.</p>
  
  <p>Edit: </p>
  
  <p>This is my error . Value connection of type java.lang.String cannot be converted to JSONObject</p>