title: Cannot Update data from android to server
body: <p>i stuck in my project when i try to update data from android
  i try to find the answer almost 2 days but i still can't solved it.
  in my logcat nothing it just show. </p>
  
  <pre><code>Error parsing data org.json.JSONException: Value &lt;br of type java.lang.String cannot be converted to JSONObject
  </code></pre>
  
  <p>but in my emulator not force close. just nothing happen and not change the intent.</p>
  
  <p>here is my code</p>
  
  <pre><code>EditText  firstname,middlename,lastname,aliasname,inputgender,inputcity,inputdate,inputmonth,inputyear;
  
      String ID;
      Button save,cancel;
  
          private static final String TAG_SUCCESS = "success";
  
       private ProgressDialog pDialog;
       JSONParser jParser = new JSONParser();
          private static final String TAG_PRODUCT = "person";
  
           firstname = (EditText) findViewById(R.id.editcreatefirstname);
           middlename = (EditText) findViewById(R.id.editmiddlename);
           lastname = (EditText) findViewById(R.id.editlastname);
           aliasname = (EditText) findViewById(R.id.editaliasname);
           inputgender = (EditText) findViewById(R.id.editgender);
           inputcity = (EditText) findViewById(R.id.editcity);
           inputdate = (EditText) findViewById(R.id.editdate);
           inputmonth = (EditText) findViewById(R.id.editmonth);
           inputyear = (EditText) findViewById(R.id.edityear);
           save =(Button) findViewById(R.id.btnsave);
  
           save.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View arg0) {
                  // TODO Auto-generated method stub
                  new SavePerson().execute();
              }
          });
  
  
          class SavePerson extends AsyncTask&lt;String, String, String&gt;{
  
          @Override
          protected void onPreExecute() {
              super.onPreExecute();
              pDialog = new ProgressDialog(Update.this);
              pDialog.setMessage("Saving product ...");
              pDialog.setIndeterminate(false);
              pDialog.setCancelable(true);
              pDialog.show();
          }
          @Override
          protected String doInBackground(String... args) {
              // TODO Auto-generated method stub
                  String name = firstname.getText().toString();
                  String middle = middlename.getText().toString();
                  String last = lastname.getText().toString();
                  String alias = aliasname.getText().toString();
                  String gender = inputgender.getText().toString();
                  String city = inputcity.getText().toString();
                  String date = inputdate.getText().toString();
                  String month = inputmonth.getText().toString();
                  String year = inputyear.getText().toString();
  
                  // Building Parameters
                  List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
                  params.add(new BasicNameValuePair("FirstName", name));
                  params.add(new BasicNameValuePair("MiddleName", middle));
                  params.add(new BasicNameValuePair("LastName", last));
                  params.add(new BasicNameValuePair("AliasName", alias));
                  params.add(new BasicNameValuePair("Gender", gender));
                  params.add(new BasicNameValuePair("CityBirth", city));
                  params.add(new BasicNameValuePair("DateBirth", date));
                  params.add(new BasicNameValuePair("MonthBirth", month));
                  params.add(new BasicNameValuePair("YearBirth", year));
  
                  String url_save_product = "http://10.0.2.2/update.php?ID_Person="+ID;
                  JSONObject json = jParser.makeHttpRequest(url_save_product, "POST", params);
                  try {
                      int success = json.getInt(TAG_SUCCESS);
                      if (success == 1) {
                          Intent i = new Intent(getApplicationContext(),SingleView.class);
                          startActivity(i);
                      } else {
  
                      }
                  } catch (JSONException e) {
                      // TODO: handle exception
                      e.printStackTrace();
                  }
              return null;
          }
          protected void onPostExecute(String file_url){
              pDialog.dismiss();
          }
      }
  </code></pre>
  
  <p>and this is my PHP code :</p>
  
  <pre><code>&lt;?
   include "new.php";
   $response = array();
   if (isset($_POST["ID_Person"]) &amp;&amp; isset($_POST['FirstName']) &amp;&amp; isset($_POST['MiddleName']) &amp;&amp; isset($_POST['LastName'])&amp;&amp; isset($_POST['AliasName'])&amp;&amp; isset($_POST['Gender'])&amp;&amp; isset($_POST['CityBirth'])&amp;&amp; isset($_POST['DateBirth'])&amp;&amp; isset($_POST['MonthBirth'])&amp;&amp; isset($_POST['YearBirth'])) {
  
   $id = $_POST['ID_Person'];
   $name =  $_POST['FirstName'];
   $middle =  $_POST['MiddleName'];
   $last =  $_POST['LastName'];
   $alias =  $_POST['AliasName'];
   $gender =  $_POST['Gender'];
   $citybirth =  $_POST['CityBirth'];
   $datebirth =  $_POST['DateBirth'];
   $monthbirth =  $_POST['MonthBirth'];
   $yearbirth =  $_POST['YearBirth'];
  
   $query = "Update T_Person SET First_Name_Person = '$name', Middle_Name_Person =      '$middle', Last_Name_Person = '$last', Alias_Person = '$alias', Gender_Person = '$gender',  City_Birth_Person = '$citybirth', Date_Birth_Person = '$datebirth', Month_Birth_Person = '$monthbirth', Year_Birth_Person = '$yearbirth' WHERE ID_Person = '$id'";
   $hasil = sqlsrv_query($conn,$query,$response);
   $row = sqlsrv_row_affected($hasil);
   if($row){
      $response["success"] = 1;
      $response["message"] = "Product successfully created.";
  
      // echoing JSON response
      echo json_encode($response);
      }
   }  else {
  echo 'Data gagal disimpan';
  } 
  
  ?&gt;
  </code></pre>
  
  <p>please anyone to help me. i will appreciate your help for me</p>