Query error in [SELECT ch_fotogalerie_fotky.id AS id, ch_fotogalerie_fotky.nazev AS nazev, ch_fotogalerie_fotky.nazev_txt AS nazev_txt, ch_fotogalerie_fotky.nazev_txt_pripona AS nazev_txt_pripona, ch_fotogalerie_fotky.popis AS popis, ch_fotogalerie_fotky.poradi AS poradi, ch_fotogalerie_fotky.publikovano AS publikovano, ch_fotogalerie_fotky.id_fotogalerie AS id_fotogalerie FROM ch_fotogalerie_fotky LEFT JOIN ch_fotogalerie ON ch_fotogalerie_fotky.id_fotogalerie = ch_fotogalerie.id WHERE ch_fotogalerie_fotky.id_fotogalerie = AND (ch_fotogalerie_fotky.publikovano = 1 OR ch_fotogalerie.id_uzivatele = 0) ORDER BY poradi ASC]. 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 (ch_fotogalerie_fotky.publikovano = 1 OR ch_fotogalerie.id_uz' at line 10.