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 '(`sklad` > '0' OR `stav` LIKE 'sklad') AND AND vyrobek.id_master<=0 AND vyro...' at line 5SELECT *, sklad,inventarizovano, vyrobci.id AS vyrobciId, vyrobci.nazev_vyrobce,id_vyrobce, vyrobek.id AS vyrobekId, vyrobek.nazev AS nazevVyrobku, vyrobek.cena,vyrobek.cena2,vyrobek.cena1, vyrobek.obrazek, vyrobek.id_soubor, vyrobek.setcena, vyrobek.stav, vakci,pridano,akcnicena, MATCH (vyrobek.nazev) AGAINST ('Shimano%XT%brzda%Disc%BR-M785%-%SET%-%černé' IN BOOLEAN MODE) AS relevance FROM vyrobek,vyrobci,kategorie WHERE (povoleno=1 OR id_shop=0) AND vyrobek.id_vyrobce=vyrobci.id AND vyrobek.kategorie=kategorie.id AND MATCH (vyrobek.popis) AGAINST ('Shimano%XT%brzda%Disc%BR-M785%-%SET%-%černé' IN BOOLEAN MODE) AND (`stav`!='smazano' OR `sklad`>'0') (`sklad` > '0' OR `stav` LIKE 'sklad') AND AND vyrobek.id_master<=0 AND vyrobek.cena < '999999' ORDER BY relevance DESC, cena DESC,poradi,kategorie LIMIT 0,10