Неверный запрос SELECT goods.id FROM goods LEFT JOIN categgood ON goods.id = categgood.idg LEFT JOIN vendors ON goods.idvendor = vendors.id LEFT JOIN good_types ON goods.idtype = good_types.id LEFT JOIN goods_types_links gtl ON gtl.idgood = goods.id LEFT JOIN pricematras ON goods.id = pricematras.idgood WHERE goods.invisible = 0 AND good_types.invisible = 0 AND (goods.price <> 0 OR pricematras.price <> 0) AND vendors.id <> 81 AND goods.id in () AND (goods.idtype IN (323,2426,727,734,1128,1719,1720,551,332,325,821,1863,360,839,840,3422,2121,2122,2123,1042,2918,3203,2267,618,1420,1421,1509,2008,2850,2851,2852,2854,2979,862,863,864,1175,1539,1744,1856,2933,2420,550,409,603,1680,1681,378,1542,1800,2456,982,983,984,985,1262,576,1727,1788,1866,1867,2067,2118,2119,2447,1236,1237,1682,1847,2197,1637,1638,1640,1976,2019,2563,1881,1864,1882,1954,2117,2136,2140,2552,2553,1941,1942,1946,1951,2025,2041,2352,2354,2368,1374,1370,1375,1377,1378,1379,1889,709,1253,2929,2930,2931,1292,721,1924,1925,1926,2576,2577,2578,2579,813,814,815,816,2870,2867,2868,2871,2793,2211,2212,2213,2214,2215,2498,2499,2500,2501,2502,2503,2513,2223,3046,3299,3300,3301,3083,3473,3474,3475,3480,3488,3489,3490,3491,3505,3506,715,2939,2940,2941,2832,1603,1605,1606,3328,3329,3347,3348,2272,991,1575,3122,2465,822,504,823,824,2408,3014,3016,3017,3226,2337,2338,2339,2340,2341,2342,2343,2344,2876,2268,3105,3106,3107,2452,2269,3186,3187,3189,3190,3191,3192,1030,1031,1904,1906,1908,1909,1907,3087,595,3446,3543,3546,3545,1686,1573,1574,878,881,1351,1355,2471,741,742,743,2030,2088,2089,2090,2091,2837,3144,3414,711,712,714,2097,2098,2099,2100,2101,2102,2103,2104,2105,2109,2110) OR gtl.idtype IN (323,2426,727,734,1128,1719,1720,551,332,325,821,1863,360,839,840,3422,2121,2122,2123,1042,2918,3203,2267,618,1420,1421,1509,2008,2850,2851,2852,2854,2979,862,863,864,1175,1539,1744,1856,2933,2420,550,409,603,1680,1681,378,1542,1800,2456,982,983,984,985,1262,576,1727,1788,1866,1867,2067,2118,2119,2447,1236,1237,1682,1847,2197,1637,1638,1640,1976,2019,2563,1881,1864,1882,1954,2117,2136,2140,2552,2553,1941,1942,1946,1951,2025,2041,2352,2354,2368,1374,1370,1375,1377,1378,1379,1889,709,1253,2929,2930,2931,1292,721,1924,1925,1926,2576,2577,2578,2579,813,814,815,816,2870,2867,2868,2871,2793,2211,2212,2213,2214,2215,2498,2499,2500,2501,2502,2503,2513,2223,3046,3299,3300,3301,3083,3473,3474,3475,3480,3488,3489,3490,3491,3505,3506,715,2939,2940,2941,2832,1603,1605,1606,3328,3329,3347,3348,2272,991,1575,3122,2465,822,504,823,824,2408,3014,3016,3017,3226,2337,2338,2339,2340,2341,2342,2343,2344,2876,2268,3105,3106,3107,2452,2269,3186,3187,3189,3190,3191,3192,1030,1031,1904,1906,1908,1909,1907,3087,595,3446,3543,3546,3545,1686,1573,1574,878,881,1351,1355,2471,741,742,743,2030,2088,2089,2090,2091,2837,3144,3414,711,712,714,2097,2098,2099,2100,2101,2102,2103,2104,2105,2109,2110)) GROUP BY goods.id
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 (goods.idtype IN (323,2426,727,734,1128,1719,1720,551,332,325,821,1863,360' at line 9