Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Change Gameadmin privileagues to player with given playerId
- *
- * @param Int $playerId
- */
- public static function grant($playerId) {
- $query = 'UPDATE players SET ' .
- 'is_admin = 0 ' .
- 'WHERE playerId IN ( ' .
- ' SELECT id ' .
- ' FROM players ' .
- ' WHERE game_id = ( ' .
- ' SELECT game_id ' .
- ' FROM players ' .
- ' WHERE id = ? ' .
- ' ) ' .
- '); ' .
- 'UPDATE players SET ' .
- 'is_admin = 1 ' .
- 'WHERE playerId = ?;';
- return self::$db->query($query, array($playerId, $playerId))->rowCount() > 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement