mysqli error: [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 NOT (status LIKE "%ukryty%") AND w.ilosc IS NOT NULL GROUP BY p.id HAVING CO' at line 4] in EXECUTE("SELECT DISTINCT(p.id) FROM produkty p LEFT JOIN wersje w ON w.produkt_id = p.id AND w.ilosc > 0 LEFT JOIN wersje_cechy wc ON w.id=wc.wersja_id AND wc.cecha_klucz="kolor" LEFT JOIN wersje_cechy wc2 ON w.id=wc2.wersja_id AND wc2.cecha_klucz="rozmiar" LEFT JOIN wersje_modele_cen wmc ON w.id=wmc.wersja_id LEFT JOIN wersje pw ON pw.produkt_id = p.id WHERE AND NOT (status LIKE "%ukryty%") AND w.ilosc IS NOT NULL GROUP BY p.id HAVING COUNT(pw.id) > 0 ORDER BY priorytet DESC, id DESC")