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 8
SELECT adressen.Name
FROM organisationen, adressen
WHERE
organisationen.OrgId = adressen.organisation AND
adressen.Funktion = 'Organisation' AND
organisationen.OrgId =