title: Android Studio-Kotlin : Value <br of type java.lang.String cannot be converted to JSONObject
body: <p>This is my php file :
  I want to Insert data into detaildonasi based on last id in donasi table </p>
  
  <pre><code>&lt;?php
  
  $conn = new mysqli("localhost","root","","donasiku");
  $sql = "SELECT * FROM donasi ORDER BY id DESC LIMIT = 1";
  $result = $conn-&gt;query($sql);
  
  if($result === TRUE)
  {
      $id = $result-&gt;fetch_assoc();
      $jumlah = $_POST['jumlah'];
      $kebutuhanid = $_POST['kebutuhanid'];
  
      $sql2 = "INSERT INTO detaildonasi VALUES('','$jumlah','$id','$kebutuhanid')"
      $result2 = $conn-&gt;query($sql2);
  
      if($result2 === TRUE)
      {
          $arr = array('hasil' =&gt; 'success');
      }
      else
      {
          $arr = array('hasil' =&gt; $conn-&gt;error);
      }
  }
  else
  {
      $arr = array('hasil' =&gt; $conn-&gt;error);
  }
  
  echo json_encode($arr);
  $conn-&gt;close();
  
  ?&gt;
  </code></pre>
  
  <p>This is the Volley of my Fragment file :</p>
  
  <pre><code>val q2 = Volley.newRequestQueue(this.context)
  val url2 = "http://10.0.2.2/donasiku/detaildonasi.php"
  val sr2 = object:StringRequest(Request.Method.POST,url2,Response.Listener {
        response -&gt; try{
        val obj2 = JSONObject(response)
        Toast.makeText(this.context,obj2.getString("hasil"), Toast.LENGTH_SHORT).show()
        }catch (e:JSONException){Toast.makeText(this.context, e.message.toString(), Toast.LENGTH_SHORT).show()}
        },Response.ErrorListener {  })
        {
          override fun getParams(): Map&lt;String, String&gt; {
          val params2 = HashMap&lt;String, String&gt;()
          for(donasi in daftarDonasiUser)
           {
              params2.put("jumlah",donasi.jumlahbarang.toString())
              params2.put("kebutuhanid",donasi.idbarang.toString())
           }
              return params2
  
              }
           }
  
           q2.add(sr2)
  </code></pre>
  
  <p>The code goes into catch JSONException and Toast Value br of type java.lang.String cannot be converted to JSONObject.</p>