@ -37,7 +37,6 @@ function insertUserAndReturnList(): array|int
);";
mysqli_query($res, $query);
if (!empty($_POST)) { //Check if the method POST return something
$id = $_POST['id']; //Get the result of POST method
@ -56,7 +55,7 @@ function insertUserAndReturnList(): array|int
$query = "SELECT id FROM gps WHERE id = '$id' ";
$results = mysqli_query($res, $query); //Execute the SQL command
if (empty($results)){
if (empty($results->fetch_row()[0])){
$query = "INSERT INTO gps(id,latitude,longitude,idMusic,dateLog) VALUES('$id','$latitude','$longitude','$idMusic',CURRENT_TIMESTAMP);"; //Insert into the database the new data and new information about this user
@ -87,10 +86,7 @@ function insertUserAndReturnList(): array|int