check.php

<?php
    $query = "SELECT TIMESTAMP FROM TABLENAME WHERE (GETDATE() - TIMESTAMP) > 60";
    $result = mysqli_query($query, $con);
    while($row = mysqli_fetch_assoc($result)){
        $uid = $row["user_id"];
        mysqli_query("UPDATE TABLENAME SET STATUS = 'offline' WHERE USER_ID = '$uid'");
    }
exit;
Başa dön tuşu