I know its wrong but how to make it working.
PHP:
$v1 = $SQL->query ('SELECT COUNT(*) as `vocation` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = '.$guild_id.') WHERE `vocation`=1;')->fetch();