title: Post an integer value over HTTP in Android using nameValuePairs
body: <p>I am trying to post a game high-score to my database table, but I cannot figure out how to do this by passing an integer value, only strings. The following is the method I want to call when the game ends, this should insert the score into the score column of my table.</p>
  
  <pre><code>    public void postData() {
  
  
      // Create a new HttpClient and Post Header
      HttpClient httpclient = new DefaultHttpClient();
      HttpPost httppost = new HttpPost("http://deucalion0.co.uk/insert.php");
  
      try {
          // Add your data
          List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(1);
          nameValuePairs.add(new BasicNameValuePair("score", finalscore));    //"score" is the name of the database table, finalscore is the integer that contains the value
          httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  
          // Execute HTTP Post Request
          HttpResponse response = httpclient.execute(httppost);
  
      } catch (ClientProtocolException e) {
          // TODO Auto-generated catch block
      } catch (IOException e) {
          // TODO Auto-generated catch block
      }
  } 
  </code></pre>
  
  <p>I am getting a red line under the parameters "score", finalscore as it tells me it can only take a string, and it knows that final score is an integer.</p>
  
  <p>If I can figure this out, I will then create a way where the user can enter a name via a form input and this will be entered into the user column of the table along with the score. I have searched through Stackoverflow for help with integers and nameValuePairs but could not find anything.</p>
  
  <p>I appreciate any assistance.</p>
  
  <p>Thanks.</p>