From 7983f404637f56aa0667a7d1f42f38009446642e Mon Sep 17 00:00:00 2001 From: Dorian HODIN Date: Tue, 29 Nov 2022 15:25:56 +0100 Subject: [PATCH] insertAndMakeListUser.php now delete afk user (10 min) / deleting test.php --- .../php_script/script/insertAndMakeListUser.php | 4 ++-- Sources/php_script/script/test.php | 16 ---------------- 2 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 Sources/php_script/script/test.php diff --git a/Sources/php_script/script/insertAndMakeListUser.php b/Sources/php_script/script/insertAndMakeListUser.php index 845afa1..dda7831 100644 --- a/Sources/php_script/script/insertAndMakeListUser.php +++ b/Sources/php_script/script/insertAndMakeListUser.php @@ -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 diff --git a/Sources/php_script/script/test.php b/Sources/php_script/script/test.php deleted file mode 100644 index 840985e..0000000 --- a/Sources/php_script/script/test.php +++ /dev/null @@ -1,16 +0,0 @@ -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 -} \ No newline at end of file