Add missing quotes...

This commit is contained in:
Klaus-Uwe Mitterer 2016-08-05 20:26:10 +02:00
parent a2131f6ee7
commit d2a9dd41c3

View file

@ -10,7 +10,7 @@ if (isset($_GET["lat"]) && preg_match("/^-?\d+\.\d+$/", $_GET["lat"]) && isset($
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO tracker (device, lat, lon) VALUES (" . mysqli_real_escape_string($conn, $_GET['device']) . ", " . mysqli_real_escape_string($conn, $_GET['lat']) . ", " . mysqli_real_escape_string($conn, $_GET['lon']) . ");";
$sql = "INSERT INTO tracker (device, lat, lon) VALUES ('" . mysqli_real_escape_string($conn, $_GET['device']) . "', " . mysqli_real_escape_string($conn, $_GET['lat']) . ", " . mysqli_real_escape_string($conn, $_GET['lon']) . ");";
if (!mysqli_query($conn, $sql)) {
die('Error: ' . mysqli_error($conn));