2014-10-23 02:50:41 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 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) ) WHERE t.item_id IN(36709, 48256, 36713, 36737, 36749, 36757, 36765, 38037, 42251, 43901, 43905, 43958, 46841, 47903, 47905, 7256, 36763, 41035, 43900, 43904, 43908, 5215, 7255, 7401, 7516, 2755, 34760, 3523, 3527, 3539, 5216, 2838, 7253, 7941, 1497, 2833, 36741, 36747, 36751, 36755, 36759, 42981, 43902, 3528, 43906, 3318, 3517, 3520, 6338, 5213, 3452, 3519, 3538, 3543, 3545, 5901, 3884, 5212, 7252, 8035, 34460, 36715, 36727, 36731, 36735, 36739, 36743, 3319, 1460, 1356, 1464, 3524, 3521, 1463, 3529, 1465, 3541, 3531, 5144, 3532, 7257, 7258, 7260, 2749, 3534, 7250, 1291, 1594, 2837, 2839, 2840, 2841, 2843, 2845, 2847, 2927, 2928, 3546, 7390, 7410, 7416, 7988, 37972, 34764, 36685, 36687, 36689, 36691, 36693, 36695, 36697, 36699, 36701, 36703, 36705, 36707, 36711, 36725, 36733, 36745, 36753, 36761, 36775, 36777, 36781, 36787, 36789, 36793, 37579, 37982, 38034, 38035, 38036, 38039, 43899, 43903, 3522, 43907, 3533, 44484, 3526, 47277, 47904, 47906, 3323, 47907, 2719, 47908, 3518, 47909, 47910, 47911, 3535, 3530, 3540, 5217, 7745, 37603, 37605, 46386, 46390, 40573, 46392, 45850, 45851, 45853, 45857, 40101, 46370, 6338, 41156, 43956, 44253, 45848, 45854, 46396, 40103, 40105, 45863, 46380, 3082, 6517, 5908, 37079, 5910, 34307, 34773, 6240, 7269, 6818, 40580, 3905, 40108, 40576, 40577, 40579, 40584, 41155, 46382, 46384, 46388, 6220, 40094, 45852, 46376, 45856, 3071, 7081, 7905, 8054, 8058, 44614, 37604, 40106, 45865, 41102, 41157, 44252, 45849, 45855, 46372, 46374, 46378, 4945, 40080, 6726, 40095, 40096, 40097, 40098, 46394, 41154, 40099, 40100, 40102, 40104, 40107, 1466, 2337, 2338, 45858, 45859, 2339, 45860, 45861, 2745, 2860, 45862, 45864, 3421, 5146, 5904, 5905, 5907, 5909, 6239, 37078, 8061, 40109, 41101, 1734, 5194, 1736, 37607, 44234, 34470, 37606, 44241, 47389, 36985, 41106, 40569, 41112, 41117, 37609, 40584, 44236, 44508, 5188, 37610, 47691, 40553, 47693, 41104, 41108, 41113, 1737, 44644, 40571, 41099, 41105, 41109, 41114, 41118, 3060, 5189, 40551, 44238, 43959, 45514, 1445, 36988, 44507, 5975, 37613, 40549, 40557, 40561, 40565, 44233, 44235, 44237, 44239, 44781, 5978, 4383, 5184, 36982, 41110, 2743, 45517, 7988, 36984, 36987, 41111, 40580, 41107, 34731, 41115, 37608, 40573, 41100, 5195, 40559, 40563, 40567, 45520, 46077, 5181, 44232, 37611, 40547, 44240, 37575, 37580, 37584, 37565, 37588, 37568, 37592, 37594, 37598, 37577, 42980, 37582, 37566, 37590, 37564, 37570, 37567, 37572, 37569, 37571, 37574, 37576, 37573, 37578, 37581, 37599, 37583, 37601, 37585, 37587, 37591, 37593, 37595, 40641, 39237, 7344, 37133, 37134, 38033, 40640, 34153, 44874, 47028, 2655, 44229, 4600, 3885, 44869, 6274, 5434, 34147, 1726, 47634, 3651, 5436, 43964, 5433, 34132, 46069, 47032, 4987, 7158, 44868, 44872, 44875, 46068, 46552, 47027, 2656, 47029, 2657, 47031, 2663, 2784, 2653, 40982, 43858, 5437, 43965, 5439, 44231, 44871, 40979, 40983, 7127, 7738, 44870, 46067, 46553, 47030, 44873, 38709, 38748, 38191, 38712, 38717, 38719, 38720, 38734, 38785, 38739, 38163, 38173, 38177, 38193, 38672, 38676, 38746, 38744, 38745, 38747, 38740, 38167, 38171, 38759, 38773, 38711, 38722, 38723, 38699, 38708, 38165, 38724, 38738, 38725, 38726, 38727, 38729, 38741, 38743, 38730, 38731, 38680, 38713, 38732, 38721, 38169, 38733, 38175, 38735, 38179, 38736, 38737, 38181, 38742, 38671, 38681, 38673, 38683, 38183, 38710, 38185, 38187, 38189, 38236, 38674, 38677) AND t.active=1 AND ((colors.color_id='459')) 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)