prepare(' SELECT s.*, ( SELECT COUNT(`game_id`) FROM `col_games` WHERE `sys_id` = s.`sys_id` ) AS `sys_games`, ( SELECT COUNT(`game_id`) FROM `col_games_ownership` WHERE `game_id` IN ( SELECT `game_id` FROM `col_games` WHERE `sys_id` = s.`sys_id` ) ) AS `sys_games_owned` FROM `col_systems` AS s ORDER BY `sys_games_owned` DESC '); $getSystems->execute(); $systems = $getSystems->fetchAll(PDO::FETCH_OBJ); $systems = [ -1 => (object)[ 'sys_id' => 0, 'sys_short' => 'all', 'sys_name' => 'All Games', 'sys_link' => 'games.php', ], ] + $systems; ?> Game Collection

Game Collection

sys_games) && $system->sys_games < 1) continue; ?>

sys_name;?>

sys_games)): ?>

sys_games_owned);?> of sys_games);?> gamesys_games !== 1 ? 's' : '');?>