title: Send current gps coordinates to mySQL database using google maps api
body: <p>I am trying to build a golf app in jquery where I can send the current gps coordinates to a mySQL database using a button. </p>
  
  <p>The problem is that I am new to php and I am trying to find code that i can use.
  I have built a database:</p>
  
  <ol>
  <li>ID   int 3 autoincrement </li>
  <li>LAT   float 10 </li>
  <li>LON   float 10</li>
  </ol>
  
  <p>Can someone please help with some html and php code?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
      &lt;div data-role="page" id="page1"&gt;
          &lt;div data-theme="b" data-role="header" data-position="fixed"&gt;
              &lt;h5&gt;
                  Play 9 holes
              &lt;/h5&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;p id="demo"&gt;Click the button to get your position:&lt;/p&gt;
  &lt;button onclick="getLocation()"&gt;Try It&lt;/button&gt;
  &lt;div id="mapholder"&gt;&lt;/div&gt;
  &lt;script&gt;
  var x=document.getElementById("demo");
  function getLocation()
    {
    if (navigator.geolocation)
      {
      navigator.geolocation.getCurrentPosition(showPosition,showError);
      }
    else{x.innerHTML="Geolocation is not supported by this browser.";}
    }
  
   function showPosition(position)
    {
    var latlon=position.coords.latitude+","+position.coords.longitude;
  
    var img_url="http://maps.googleapis.com/maps/api/staticmap?center="
     +latlon+"&amp;zoom=14&amp;size=400x400&amp;sensor=false";
     document.getElementById("mapholder").innerHTML="&lt;img src='"+img_url+"' /&gt;";
     }
  
   function showError(error)
    {
     switch(error.code) 
       {
     case error.PERMISSION_DENIED:
        x.innerHTML="User denied the request for Geolocation."
         break;
       case error.POSITION_UNAVAILABLE:
         x.innerHTML="Location information is unavailable."
          break;
       case error.TIMEOUT:
         x.innerHTML="The request to get user location timed out."
          break;
       case error.UNKNOWN_ERROR:
           x.innerHTML="An unknown error occurred."
         break;
       }
     }
   &lt;/script&gt;
   &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>
  
  <p>this code shows current location but there has to be a request function that can send position.coords.latitude+","+position.coords.longitude to database?</p>