title: Update MYSQL with jQuery/AJAX
body: <p>I'm trying to build a mobile application with PhoneGap and jQuery Mobile . In my app I have a page where is a link to PHP file which updates MYSQL and heads to next page. But with PhoneGap I need to have all the PHP files on external server so I can't my current solution on this application. </p>
  
  <p>This is the PHP that I use to update MYSQL</p>
  
  <pre><code>&lt;?php
  
  $var = @$_GET['id'] ;
  
  $con = mysql_connect("localhost","username","abc123");
  if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
  
  mysql_select_db("database", $con);
  
  mysql_query("UPDATE table SET condition=true
  WHERE ID= \"$var\" ");
  
  header('Location: http://1.2.3.4/test');
  
  mysql_close($con);
  ?&gt; 
  </code></pre>
  
  <p>So how can I run this PHP when user clicks a button? With jQuery/AJAX i suppose? </p>