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 (13125,13129,13142,13180,13202,13227,13251,13260,13' at line 1SELECT DISTINCT(FldAtPrimkey) FROM TblShopBestellPos JOIN TblShopArtikel ON (FldBpArtikelId = FldAtArtikelId) JOIN TblShopArtikelKat ON (FldAkPrimArtikel = FldAtPrimkey WHERE FldBpPrimBestellung IN (13125,13129,13142,13180,13202,13227,13251,13260,13273,13316,13320,13365,13396,13451,13510,13521,13532,13570,13618,13655,13682,13759,13764,13785,13801,13802,13814,13917,13923,13973,14029,14074,14181,14193,14223,14440,14556,14569,14603,14628,14680,14715,14719,14730,14817,14872,14900,14924,15089,15211) AND FldAkSegmentNr IN(1,0) AND FldAtGeloescht = 0 AND UPPER(FldAtStatus) NOT IN ('GESPERRT','INAKTIV','SYSTEM') AND FldAtWebAnzeige = 1 AND FldAtArtikelId != '700413' ORDER BY RAND() LIMIT 4