Error: SELECT `l`.`id`, `l`.`sport`, `l`.`name`, `l`.`name_short` AS `code`, `l`.`logo`, `l`.`info`, `l`.`extra`, `l`.`MinPerPeriod` AS `pLength`, `l`.`PeriodsPlayed` AS `periods`, `l`.`overtime_rule` AS `ot`, `l`.`duration` AS `otLength`, `l`.`PenaltyShots` AS `ps`, `l`.`TimeOuts` AS `timeout`, `l`.`TimeOut` AS `tLength`, `l`.`gw` AS `w`, `l`.`gwo` AS `wo`, `l`.`d` AS `d`, `l`.`glo` AS `lo`, `l`.`gl` AS `l`, (SUM(`lt`.`ranking`) >= 1)AS `ranking` FROM `v2_leagues` AS `l` INNER JOIN `v2_leagues_teams` AS `lt` ON `lt`.`league_id`=`l`.`id` AND `lt`.`id` IN () WHERE `l`.`season`='1718' AND LOWER(`l`.`name_short`)='bene' LIMIT 1

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') WHERE `l`.`season`='1718' AND LOWER(`l`.`name_short`)='bene' LIMIT 1' at line 6