2015-04-28 10:43:27 SELECT t.*, d.production_time, d.production_time_from, d.production_time_to, CONCAT(d.pimage_alt,t.item_name) AS alt_tag, d.pimage_src, d.pimage_list_src, d.pimage_list_width, d.pimage_list_height, d.smalldescr , d.onsale, IF(d.onsale=1,MIN(pg.price_sale),MIN(pg.price)) AS price_ob, IF(d.onsale=1,MAX(pg.price_sale),MAX(pg.price)) AS price_max, MIN(pg.count_from) AS mincountfrom, CONCAT_WS('/', dp.item_id, dp.icon_pic_src) AS icon_src FROM treeman AS t INNER JOIN dt_product AS d ON (d.item_id=t.item_id) INNER JOIN price_grid AS pg ON (pg.item_id=t.item_id AND pg.vendor_id IS NULL INNER JOIN pcolors AS pc ON(pc.item_id=t.item_id) INNER JOIN pcolors_colors AS pcc ON(pcc.pcolor_id=pc.pcolor_id) INNER JOIN colors ON(colors.color_id=pcc.color_id) ) LEFT JOIN field_dynamic_multi AS fdm ON (fdm.item_id = t.item_id AND fdm.field_name = 'icons') LEFT JOIN dt_prodicon AS dp ON(dp.item_id = fdm.refer_item_id) WHERE t.item_id IN(1356, 1460, 1463, 1464, 1465, 50875, 2755, 3318, 3323, 3517, 3518, 3519, 3521, 3523, 3526, 3527, 3452, 3529, 3530, 3532, 3538, 3539, 3319, 3543, 3545, 5144, 3520, 5212, 3522, 5213, 5216, 3524, 3528, 3531, 3533, 3534, 3541, 3884, 5215, 7250, 7253, 7255, 7256, 7260, 3535, 1497, 3540, 2841, 5217, 5901, 7401, 7410, 37972, 7252, 7257, 7258, 36725, 7941, 7745, 36735, 36741, 36751, 36757, 1291, 36759, 1594, 2749, 2833, 36775, 2837, 2839, 2838, 2840, 2843, 7988, 36713, 2847, 2927, 2928, 3546, 42251, 7390, 43905, 7416, 43906, 46841, 36727, 47903, 7516, 36737, 8035, 47909, 34460, 36749, 48256, 34760, 34764, 36787, 42981, 36685, 36687, 36689, 36691, 36693, 43904, 36695, 36697, 36699, 36701, 43907, 36703, 43908, 47907, 36705, 47908, 36707, 47911, 36709, 36711, 36715, 36731, 36733, 36739, 36743, 36745, 36747, 36753, 36755, 36761, 36763, 36765, 36777, 36781, 43958, 36789, 36793, 37579, 37982, 38034, 38035, 38036, 38037, 38039, 43899, 43900, 43902, 43903, 44484, 47277, 47904, 47905, 47906, 47910, 49131, 6274, 1726, 2653, 2655, 2656, 2657, 2663, 2784, 3651, 3885, 4600, 4987, 5436, 5437, 50711, 5439, 50578, 7127, 7158, 7738, 49628, 5433, 50044, 5434, 50066, 50177, 34132, 34147, 34153, 40979, 40982, 40983, 43858, 43964, 43965, 44229, 44231, 44868, 44869, 44870, 44871, 44872, 44873, 49632, 44874, 49634, 44875, 46067, 49635, 46068, 49637, 46069, 49638, 46552, 46553, 49639, 47027, 49645, 47028, 47029, 47030, 49650, 47031, 49651, 47032, 49656, 47634, 49626, 49629, 49659, 49661, 49630, 49631, 49664, 49665, 49666, 49633, 49670, 49636, 49641, 49668, 49642, 49672, 49643, 49674, 49646, 49647, 49649, 49652, 49654, 49662, 51119, 51111, 51087, 6220, 51006, 1466, 50986, 44614, 2337, 2338, 2339, 50890, 2745, 50640, 2860, 50658, 50580, 3071, 50724, 50527, 50588, 3082, 50556, 50582, 50427, 50601, 50439, 50454, 50496, 50318, 50383, 3421, 50365, 5146, 50425, 5904, 5905, 5907, 5908, 5909, 5910, 50122, 6239, 6240, 6818, 50049, 7081, 7269, 7905, 8054, 8058, 8061, 3905, 4945, 40080, 6726, 6517, 37079, 37078, 34307, 34773, 37603, 37604, 37605, 40094, 40095, 40096, 40097, 40098, 40099, 40100, 40102, 40103, 40104, 40105, 40106, 40107, 40108, 40109, 40573, 40576, 40577, 40580, 40584, 41102, 41155, 41156, 41157, 43956, 44253, 45848, 45849, 45850, 45851, 45852, 45853, 45854, 45855, 45856, 45857, 45858, 45859, 45860, 45861, 45862, 45863, 45864, 45865, 46370, 46372, 46374, 46376, 46378, 46380, 46382, 46384, 46386, 46388, 46390, 46392, 46394, 46396, 48717, 48922, 50650, 1734, 44507, 5978, 1445, 36985, 36982, 2743, 50805, 50763, 50895, 50906, 3060, 50947, 36988, 4383, 50736, 50804, 5181, 5184, 50642, 5188, 50638, 5189, 5194, 5195, 5975, 45514, 7988, 50169, 50230, 36987, 47691, 50240, 34470, 50355, 34731, 1737, 37606, 37607, 37608, 37609, 37610, 37611, 37613, 1736, 47693, 40547, 40549, 40551, 40553, 40557, 40559, 40561, 40563, 40565, 40567, 40569, 40571, 40573, 40580, 40584, 41099, 41100, 41101, 41104, 41105, 41106, 41107, 41108, 41109, 41110, 41111, 41112, 41113, 41114, 41115, 41117, 41118, 43959, 44232, 44233, 44234, 44235, 44236, 44237, 44238, 44239, 44240, 44241, 44508, 44644, 44781, 45517, 45520, 46077, 47389, 48448, 48481, 48717, 48788, 50213, 37565, 37564, 37566, 37567, 37568, 37569, 37570, 37571, 37572, 37573, 37574, 37575, 37576, 37577, 37578, 37580, 37581, 37582, 37583, 37584, 37585, 37587, 37588, 37590, 37591, 37592, 37593, 37595, 37598, 37599, 37601, 42980, 38785, 38744, 38745, 38746, 38747, 38748, 38759, 38773, 38711, 38712, 38713, 38717, 38719, 38720, 38721, 38722, 38723, 38724, 38725, 38726, 38727, 38729, 38730, 38731, 38732, 38733, 38734, 38735, 38736, 38737, 38738, 38739, 38740, 38741, 38742, 38743, 38680, 38681, 38683, 38699, 38708, 38709, 38710, 38163, 38165, 38167, 38169, 38171, 38173, 38175, 38177, 38179, 38181, 38183, 38185, 38187, 38189, 38191, 38193, 38236, 38671, 38672, 38673, 38674, 38676, 38677, 7344, 39237, 37133, 37134, 38033, 40640, 40641) AND t.active=1 AND ((colors.color_id='455')) GROUP BY t.item_id ORDER BY d.popularity DESC mysql-error - 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 'INNER JOIN pcolors AS pc ON(pc.item_id=t.item_id) INNER JOIN pcolors_colors AS p' at line 6(1064)