title: Execute PHP-File once on ButtonClick - Android
body: <p>I have a value on a database and can finally display it in a textView, now i want to update that number on buttonclick.</p>
  
  <p>The php-scripts work fine, if I open them in my browser and check my DB, the value changed +1.</p>
  
  <p>Now my question is:: How can i execute this file from my android app? I don't want to read it, I just want to execute the file once, so that the value in the DB changes. I tried it this way:</p>
  
  <p>public void updateData(String uri) {</p>
  
  <pre><code>    try {
  
          URL url = new URL(uri);
          HttpURLConnection connn = (HttpURLConnection) url.openConnection();
          connn.connect();
  
  
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>This is my PHP-File but as mentioned before it works fine::</p>
  
  <p>/*
  
  <pre><code>$con = mysql_connect('127.0.0.1', 'root', '');
  if(!$con)
      {
      die('could not connect to database' . mysql_error());
      }
      mysql_select_db('vehicles', $con);
  
      $plusOne = ("UPDATE `counter` SET cars = cars + 1 WHERE id = 1;");
  
      mysql_close($con);
  
      ?&gt; */
  </code></pre>
  
  <p>EDIT:: Ok nevermind everything works fine now :)</p>