online fix

This commit is contained in:
Igor Barkov (iwork) 2020-06-23 18:15:47 +03:00
parent 072057d86c
commit f0ede8a311

View File

@ -33,7 +33,7 @@ if ($username && $password) {
$_SESSION['sid'] = session_id();
$onl = db::c()->query('SELECT user_id FROM online WHERE user_id = "?s"', $data['id'])->fetch_assoc();
if (isset($onl['id'])) {
if (isset($onl['user_id'])) {
db::c()->query('UPDATE online SET date = ?i WHERE user_id = "?s"', time(), $data['id']);
} else {
db::c()->query('INSERT INTO online (user_id, date, room) VALUES (?i, ?i, ?i)', $data['id'], time(), $data['room']);