SELECT V.* FROM t_products AS P LEFT JOIN t_products_manufac AS V ON V.id = P.vyrobce WHERE P.kategorie IN (,56,18,20,21,22,23,24,35,66,11,6,59,14,57,17,13,16,26,65,1,2,4,32,64,5,25,3,10,43,39,42,41,38,45,31,33,36,28,29,27,40,47,48,61,60,37,52,30,58,53,54,55,62) AND P.publikovano = 1 GROUP BY V.id 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 '56,18,20,21,22,23,24,35,66,11,6,59,14,57,17,13,16,26,65,1,2,4,32,64,5,25,3,10,43' at line 6