prepare('SELECT username, is_moderator FROM users WHERE id = ?;'); if ($usernameStatement) { $usernameStatement->bind_param('i', $_SESSION['user']); $usernameStatement->execute(); $usernameResult = $usernameStatement->get_result(); if ($usernameResult) { $usernameRow = $usernameResult->fetch_assoc(); if ($usernameRow) { $username = $usernameRow['username']; $isModerator = boolval($usernameRow['is_moderator']); } } $usernameStatement->close(); } } ?>