Неверный запрос 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,840,3340,3422,3511,2121,2122,2123,3886,1042,2918,3203,2267,618,1420,1421,1509,2008,1529,2850,2851,2852,2854,3748,862,863,864,1175,1539,1744,1856,2842,2933,3569,3997,2420,378,1542,3633,3616,3626,3627,3628,1800,2456,982,983,984,3950,3951,3952,3953,3757,1262,576,1727,1788,1866,1867,2067,2118,2119,4037,4042,2447,1236,1237,1682,2197,3581,3584,3888,1637,1638,1640,1976,2019,2563,3530,3532,4154,1941,1942,1946,1951,2025,2041,2352,2354,2368,1374,1370,1375,1377,1378,1379,1889,805,807,1284,3968,2929,2930,2931,721,1924,1925,1926,2576,2577,2578,2579,3694,813,816,2870,2867,2868,2871,2793,3145,2211,2212,2213,2214,2215,2498,2499,2500,2501,2502,2503,2513,3931,3932,3934,2223,3046,3299,3300,3301,3083,3473,3474,3475,3480,3488,3489,3490,3491,3505,3506,2939,2940,2941,3729,3730,3731,4006,1603,1605,1606,3328,3329,3347,3348,2272,991,1575,3122,2465,822,504,823,824,2408,4155,4156,3014,3016,3017,3552,3226,4103,4102,4101,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,1909,1907,3087,3775,3776,3777,3778,595,3446,3543,3546,3545,1686,1573,1574,878,880,881,3919,3920,3921,3922,3923,4147,2471,741,742,743,2030,2088,2089,2090,2091,2837,3144,3414,711,712,713,714,2101,2102,2103,2097,2098,2099,2105,2104,2100,2109,2110) OR gtl.idtype IN (323,2426,727,734,1128,1719,1720,551,332,325,821,1863,360,840,3340,3422,3511,2121,2122,2123,3886,1042,2918,3203,2267,618,1420,1421,1509,2008,1529,2850,2851,2852,2854,3748,862,863,864,1175,1539,1744,1856,2842,2933,3569,3997,2420,378,1542,3633,3616,3626,3627,3628,1800,2456,982,983,984,3950,3951,3952,3953,3757,1262,576,1727,1788,1866,1867,2067,2118,2119,4037,4042,2447,1236,1237,1682,2197,3581,3584,3888,1637,1638,1640,1976,2019,2563,3530,3532,4154,1941,1942,1946,1951,2025,2041,2352,2354,2368,1374,1370,1375,1377,1378,1379,1889,805,807,1284,3968,2929,2930,2931,721,1924,1925,1926,2576,2577,2578,2579,3694,813,816,2870,2867,2868,2871,2793,3145,2211,2212,2213,2214,2215,2498,2499,2500,2501,2502,2503,2513,3931,3932,3934,2223,3046,3299,3300,3301,3083,3473,3474,3475,3480,3488,3489,3490,3491,3505,3506,2939,2940,2941,3729,3730,3731,4006,1603,1605,1606,3328,3329,3347,3348,2272,991,1575,3122,2465,822,504,823,824,2408,4155,4156,3014,3016,3017,3552,3226,4103,4102,4101,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,1909,1907,3087,3775,3776,3777,3778,595,3446,3543,3546,3545,1686,1573,1574,878,880,881,3919,3920,3921,3922,3923,4147,2471,741,742,743,2030,2088,2089,2090,2091,2837,3144,3414,711,712,713,714,2101,2102,2103,2097,2098,2099,2105,2104,2100,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