1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and bc.iso = 'de' and b.status = 1' at line 11

select count(distinct b.brand_id) as total FROM (brands b, brands_to_category btc, brands_category bc) left join brands_to_dealers btd on b.brand_id = btd.brand_id where b.brand_id = btc.brand_id and btc.cat_id = bc.cat_id and bc.site = 'fahrradinfo' and btd.dealer_id = and bc.iso = 'de' and b.status = 1