title: how to insert data into server database with user input?
body: <p>currently, i retrieve data from database is like that</p>
  
  <pre><code>private void getdatafromphp(){
      ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();
      //http post
      try{
          HttpClient httpclient = new DefaultHttpClient();
          HttpPost httppost = new HttpPost("http://10.0.2.2/video.php");
          httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
          HttpResponse response = httpclient.execute(httppost);
          HttpEntity entity = response.getEntity();
          is = entity.getContent();
      }catch(Exception e){
          Log.e("log_tag", "Error in http connection"+e.toString());
      }
         //convert response to string
      try{
          BufferedReader reader = new BufferedReader(new InputStreamReader(is,"iso-8859-1"),8);
          sb = new StringBuilder();
          sb.append(reader.readLine() + "\n");
          String line="0";
          while ((line = reader.readLine()) != null) {
              sb.append(line + "\n");
          }
          is.close();
          result=sb.toString();
      }catch(Exception e){
           Log.e("log_tag", "Error converting result "+e.toString());
      }
                 //paring data
      try{
          jArray = new JSONArray(result);
          JSONObject json_data=null;
          json_data = jArray.getJSONObject(jArray.length()-1);
          url=json_data.getString("VideoUrl");
      }catch(JSONException e1){
      }catch(ParseException e1) {
          e1.printStackTrace();
      }
  }
  </code></pre>
  
  <p>with this php </p>
  
  <pre><code>&lt;?php
  mysql_connect("localhost","root","");
  mysql_select_db("imammuda");
  $sql=mysql_query("select * from Video");
  while($row=mysql_fetch_assoc($sql))
  $output[]=$row;
  print(json_encode($output));
  mysql_close();
  ?&gt;
  </code></pre>
  
  <p>now i want insert data into database. how to do that?</p>
  
  <p>I had found the sql command which is "insert into table (column1, column2) values ('value1', 'value2')". </p>
  
  <p>This is insert with constant values which is type in php. </p>
  
  <p>What i want is from java there get input from user then copy this input into php 'value1' after that run the php to update the database.</p>