SQL hiba!

select distinct a.uid from fws__article a left join fws__art_grp g on (g.id=a.art_grp_no) left join fws__art_grp_key k on (k.art_id=a.id) where a.visible=1 and g.visible=1 and a.brand=
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 '' at line 1