Invalid MySQL query: 1064: 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 'AND b.aktiv
ORDER BY a.sort' at line 4
SELECT b.id AS bildid, b.bild
FROM produkt_bilder_hub AS a
LEFT JOIN produkt_bilder AS b ON ( a.produkt_bilder_id = b.id )
WHERE a.produkt_id= AND b.aktiv
ORDER BY a.sort