distancefinder/save-location1.php
2016-05-24 00:51:25 +02:00

21 lines
400 B
PHP

<?php
require_once 'bootstrap.php';
$id = dbGetVal("select id from df_locations where address='".dbEscape($_POST['location']['adr'])."'");
if($id){
echo $id;
exit;
}
dbInsert('df_locations', array(
'address' => formatAddress($_POST['location']['adr']),
'latitude' => $_POST['location']['lat'],
'longitude' => $_POST['location']['lng'],
));
echo dbGetInsertId();