title: Keep getting error Warning: PDOStatement::execute() expects at most 1 parameter, 2 given in config.php line 15
body: <p>This is my index page for my geo location page</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script src="js/jquery.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;script&gt;
  setInterval ( "onPositionUpdate()", 10000 );
  
  var currPosition;
  navigator.geolocation.getCurrentPosition(function(position) {
      updatePosition(position);
      setInterval(function(){
          var lat = currPosition.coords.latitude;
          var lng = currPosition.coords.longitude;
          $.ajax({
              type: "POST", 
              url:  "myURL/location.php", 
              data: 'x='+lat+'&amp;y='+lng, 
              cache: false
          });
      }, 2000);
  }, errorCallback); 
  
  var watchID = navigator.geolocation.watchPosition(function(position) {
      updatePosition(position);
  });
  
  function updatePosition( position ){
      currPosition = position;
  }
  
  function errorCallback(error) {
      var msg = "Can't get your location. Error = ";
      if (error.code == 1)
          msg += "PERMISSION_DENIED";
      else if (error.code == 2)
          msg += "POSITION_UNAVAILABLE";
      else if (error.code == 3)
          msg += "TIMEOUT";
      msg += ", msg = "+error.message;
  
      alert(msg);
  }
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is my location.php page</p>
  
  <pre><code>&lt;?php
    include ('config.php');
  
    // database connection
    $conn = new PDO("mysql:host=$dbhost;dbname=$dbname",$dbuser,$dbpass);
  
    // new data
  
    $x = @$_POST['x'];
    $y = @$_POST['y'];
  
    // query
    $sql = "update locations set x=?, y=? where username = asd";
    $q = $conn-&gt;prepare($sql);
    $q-&gt;execute(array($x),($y));
  
  ?&gt;
  </code></pre>
  
  <p>This is my config.php page</p>
  
  <pre><code>&lt;?php
  $dbtype     = "";
  $dbhost     = "localhost";
  $dbname     = "test";
  $dbuser     = "root";
  $dbpass     = "";
  
  ?&gt;
  </code></pre>
  
  <p>The problem is when i am on my xampp testing my geo location out 
  i keep getting a error Warning: PDOStatement::execute() expects at most 1 parameter, 2 given in C:\xampp\htdocs\project_track\myURL\location.php on line 15</p>
  
  <p>I am trying to make a app that tracks my location and upload it to my database i been working on this project for some time hopefully i am on the right track i would like to know what do i do to correct this problem can some one please help...how should i set my database up for this i would like my app to record a username and lat and long and save it to my database and retrieve it so i can use it for google maps please help me with this...</p>
  
  <p>Is my Sql wrong</p>