MySQL supports placeholders within the `LIMIT`, make use of this to avoid the
string concatenation that breaks syntax highlighting of the SQL query within
the IDE.
FROM wcf1_user_session
WHERE userID = ?
ORDER BY lastActivityTime DESC
- LIMIT " . self::USER_SESSION_LIMIT . "
+ LIMIT ?
) newest_sessions
ON newest_sessions.sessionID = all_sessions.sessionID
WHERE all_sessions.userID = ?
$statement = WCF::getDB()->prepare($sql);
$statement->execute([
$user->userID,
+ self::USER_SESSION_LIMIT,
$user->userID,
]);
foreach ($statement->fetchAll(\PDO::FETCH_COLUMN) as $sessionID) {