title: database inserting null value
body: <p>I want to insert a value into my web hosting database from my android app.It triggers my create.php script but it doesn't insert the value into the title column that I typed from my edit text.</p>
  
  <p><a href="https://i.stack.imgur.com/RubDv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RubDv.png" alt="enter image description here"></a></p>
  
  <p>This is how I insert </p>
  
  <pre><code>    try {
                  URL url = new URL("mydburl/create.php");
                  conn = (HttpURLConnection) url.openConnection();
                  conn.setRequestMethod("POST");
                  conn.setDoOutput(true);
                  //conn.setDoInput(true);
                  conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
                  //conn.setRequestProperty("Accept", "application/json");
                  //conn.connect();
  
                  //Log.d("In Async param",params[0]);
  
                  String title = params[0];
                 // Log.d("In Async title",title);
  
                  jsonObj = new JSONObject();
                  jsonObj.put("title", title);
                  //Log.d("In Async Json toString",jsonObj.toString());
              } catch (MalformedURLException e) {
                  e.printStackTrace();
              } catch (ProtocolException e) {
                  e.printStackTrace();
              } catch (IOException e) {
                  e.printStackTrace();
              } catch (JSONException e) {
                  e.printStackTrace();
              }
              try {
  
                  os = (conn.getOutputStream());
                  os.write(jsonObj.toString().getBytes("UTF-8"));
                  //os.flush();
                  os.close();
              } catch (IOException e) {
                  e.printStackTrace();
              }
  
              try {
                  Log.e("connection status",conn.getResponseMessage());
                  InputStream in = new BufferedInputStream(conn.getInputStream());
                  BufferedReader reader = new BufferedReader(new InputStreamReader(in));
                  strBuilder = new StringBuilder();
                  String line;
                  while ((line = reader.readLine()) != null) {
                      strBuilder.append(line);
                  }
                  os.close();
                  reader.close();
                  conn.disconnect();
  
              } catch (IOException e) {
                  e.printStackTrace();
              }
  </code></pre>
  
  <p>On my android studio log cat, the reflects that the connection status is ok.
  <a href="https://i.stack.imgur.com/s6aSU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s6aSU.png" alt="enter image description here"></a></p>
  
  <p>I also did some debugs in my async task method.(fffg is what I typed in my edit text)</p>
  
  <pre><code>Log.d("In Async param",params[0]); 
  Log.d("In Async Json toString",jsonObj.toString());  
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/suFVG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/suFVG.png" alt="enter image description here"></a></p>
  
  <p>This is my php script(create.php). </p>
  
  <pre><code>&lt;?php
      $response = array();
      $servername = "myservername";
      $username = "user";
      $password = "pwd";
      $dbname = "myDB";
  
      $con=mysql_connect("$servername","$username","$password");
      mysql_select_db("$dbname", $con);
      $title=$_POST['title'];
      mysql_query("INSERT INTO Test(title) VALUES ('$title')");
      header('Content-type: application/json; charset=UTF-8');
  ?&gt;
  </code></pre>
  
  <p>Please help.</p>