insertAndMakeListUser.php now delete afk user (10 min) / deleting test.php

remotes/origin/database-api-implementation
Dorian HODIN 2 years ago committed by felixmielcarek
parent 10cf8b1bac
commit 4f19c821e3

@ -47,8 +47,8 @@ function insertUserAndReturnList(): array|int
$latitude = doubleval($latitude); //Convert a string to a double
$longitude = doubleval($longitude); //Convert a string to a double
//$query = "DELETE FROM gps WHERE (TIMESTAMPDIFF(MINUTE,dateLog,CURRENT_TIMESTAMP)<10);";
//mysqli_query($res, $query);
$query = "DELETE FROM gps WHERE (TIMESTAMPDIFF(MINUTE,dateLog,NOW())>10);";
mysqli_query($res, $query);
$query = "SELECT id FROM gps WHERE id = '$id' ";
$results = mysqli_query($res, $query); //Execute the SQL command

@ -1,16 +0,0 @@
<?php
include "config.php";
$res = connection();
$query = "SELECT id,TIMESTAMPDIFF(MINUTE,dateLog,NOW()) FROM gps ;";
$results = mysqli_query($res, $query);
while ($row = $results->fetch_row()) { //For all the row in the database
print($row[0]);
print($row[1]); //Set $lat2 to the latitude of the user who is in the actual row
//Set $lat2 to the latitude of the user who is in the actual row
}
Loading…
Cancel
Save