<?php
require '../connForms/acdet.php';

$userName = $_POST['userName'];


$mysqli = new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME);

$userName = $mysqli->real_escape_string($userName);

$sql = "SELECT latitude, longitude FROM accounts WHERE username='$userName'";
$result = $mysqli->query($sql);

if ($result->num_rows > 0) {
    $row = $result->fetch_assoc();
    $latitudeStr = $row["latitude"];
    $longitudeStr = $row["longitude"];
}

echo $latitudeStr."-".$longitudeStr;

$mysqli->close();

?>