我如何保存标记位置长lat到sql(javascript,php)

Excuse me, anyway srry i'm newbie from programming website, how do i start or where i go start a php code to get marker value long lat from javascript to save to sql. Can someone give php example from my javascript code ? thx for helping.

Here is the code

HTML

<input id="pac-input" class="controls" type="text" placeholder="Masukkan Nama Lokasi....">
<div id="map"  style="width:100%;height:500px;"></div>

Javascript

<script>

    function initMap() {
    var map = new google.maps.Map(
    document.getElementById("map"), {
    center: new google.maps.LatLng(1.474087, 124.841948),
    zoom: 15,
    mapTypeId: google.maps.MapTypeId.ROADMAP
    });

    google.maps.event.addListener(map, "click", function(e) {

    latLng = e.latLng;

    console.log(e.latLng.lat());
    console.log(e.latLng.lng());

    console.log("Marker");
    // if marker exists and has a .setMap method, hide it
    if (marker && marker.setMap) {
    marker.setMap(null);
    }
    marker = new google.maps.Marker({
    position: latLng,
    map: map
    });
    });

    var input = document.getElementById('pac-input');

    var autocomplete = new google.maps.places.Autocomplete(
        input, {placeIdOnly: true});
    autocomplete.bindTo('bounds', map);

    map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);

    var infowindow = new google.maps.InfoWindow();
    var infowindowContent = document.getElementById('infowindow-content');
    infowindow.setContent(infowindowContent);
    var geocoder = new google.maps.Geocoder;
    var marker = new google.maps.Marker({
      map: map
    });
    marker.addListener('click', function() {
      infowindow.open(map, marker);
    });

    autocomplete.addListener('place_changed', function() {
      infowindow.close();
      var place = autocomplete.getPlace();

      if (!place.place_id) {
        return;
      }
      geocoder.geocode({'placeId': place.place_id}, function(results, status) {

        if (status !== 'OK') {
          window.alert('Geocoder failed due to: ' + status);
          return;
        }
        map.setZoom(15);
        map.setCenter(results[0].geometry.location);   
            });
        });
    }
    </script>

Can someone give php example please, or the value long and lat can save straight from javascript to sql. srry for the bad code, i'm just start to learning. Thx for help