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 'WHERE FldBpPrimBestellung IN (13144,13162,13220,13228,13286,13409,13595,13607,13' at line 1SELECT DISTINCT(FldAtPrimkey) FROM TblShopBestellPos JOIN TblShopArtikel ON (FldBpArtikelId = FldAtArtikelId) JOIN TblShopArtikelKat ON (FldAkPrimArtikel = FldAtPrimkey WHERE FldBpPrimBestellung IN (13144,13162,13220,13228,13286,13409,13595,13607,13642,13690,16057,16784,19184,19444,19556,19787,19873,19922,19939,20248,21800,22635,23168,23938,24307,25477,26247,26449,26648) AND FldAkSegmentNr IN(1,0) AND FldAtGeloescht = 0 AND UPPER(FldAtStatus) NOT IN ('GESPERRT','INAKTIV','SYSTEM') AND FldAtWebAnzeige = 1 AND FldAtArtikelId != '700706' ORDER BY RAND() LIMIT 4