getConnection(); $stmt = $pdo->prepare( "UPDATE auth_sessions SET last_activity = ? WHERE user_id = ? ORDER BY last_activity DESC LIMIT 1" ); $stmt->execute([time(), $iduserlogin]); echo json_encode(['ok' => true, 'rows' => $stmt->rowCount(), 'ts' => time()]); } catch (\Throwable $e) { echo json_encode(['ok' => false, 'error' => $e->getMessage()]); }