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 g.prywatne<>1 order by g.kolejnosc, g.id' at line 12

select distinct g.id, g.nr_ref, g.nazwa, g.nadrzedna from galerie g where g.public=1 and g.nadrzedna= and g.prywatne<>1 order by g.kolejnosc, g.id

[TEP STOP]