This is what I'm trying but I'm not sure it must be this way. I wanna charge those variables to use them in my js function later
<?php
$id = $_GET['id'];
$name = "";
$lat = '';
$lng = '';
$link = mysqli_connect("localhost", "root", "", "projectppy");
if (mysqli_connect_errno()) {
printf("Falló la conexión: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT name, lat, lng FROM customers ORDER BY ID DESC";
$result = $mysqli->query($query);
/* fetch associative array */
while ($row = $result->fetch_assoc()) {
printf("%s (%s)\n", $row["name"], $row["lat"], $row["lng"]);
}
?>