title: Query "SELECT * FROM .... WHERE ..." in PHP with POST request
body: <p>I'm trying to send a user's id from my android app and then get their information in the SQLite database on the server by using $_POST method request. Following some tutorials, I found that mysqli_query() will return an Object for the successful SELECT query. So I get the user information to read a JsonObject using Volley library in the android studio. But then, I get an error:  **Value of type java.lang.String cannot be converted to JSONObject **. I'm a newbie to PHP and Android ( just learned it from 1 month ago), please help me!. Thanks in advance.</p>
  
  <p><strong>Here is the code in php:</strong></p>
  
  <pre><code>&lt;?php
   $connect = mysqli_connect("localhost","root","","bkguardian");
   mysqli_query($connect,"SET NAME 'uft8'");
   $id = $_POST['id'];
  
   $query = "SELECT * FROM user_lock_information WHERE id = '$id' LIMIT 1";
   $data = mysqli_query($connect,$query);
  
   $row = mysqli_fetch_assoc($data);
   echo json_encode($row);
  ?&gt;
  </code></pre>
  
  <p><strong>Here is the function to get user information in adroid studio:</strong></p>
  
  <pre><code>private void getUserLockInformation(String url, final String id) {
      RequestQueue requestQueue = Volley.newRequestQueue(LogInActivity.this);
      JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST, url, null,
              new Response.Listener&lt;JSONObject&gt;() {
                  @Override
                  public void onResponse(JSONObject response) {
                      Integer numColumn = response.length();
                      lockData = new Integer[numColumn -1];
                      String nameHandle;
  
                      for (int i = 0; i&lt;=numColumn-1; i++){
                          nameHandle ="lock".concat(String.valueOf(i+1));
                          try {
                              lockData[i]= response.getInt(nameHandle);
                          } catch (JSONException e) {
                              e.printStackTrace();
                          }
                      }
                  }
              },
              new Response.ErrorListener() {
                  @Override
                  public void onErrorResponse(VolleyError error) {
                      // GET NOTIFY FOR SYSTEM ERROR, NEED TO ADD MORE ACTION.
                      Toast.makeText(LogInActivity.this, "Error system, Please report this to admin!",Toast.LENGTH_LONG).show();
                      Log.d("AAA","error \n" +error.toString());
                  }
              }){
          @Override
          protected Map&lt;String, String&gt; getParams() throws AuthFailureError {
              Map&lt;String,String&gt; param = new HashMap&lt;&gt;();
              param.put("id",id);
              return param;
          }
      };
      requestQueue.add(jsonObjectRequest);
  }
  </code></pre>