2014-12-19 02:34:52 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(1471, 5274, 7328, 37523, 37524, 37526, 7229, 37527, 41014, 37529, 41196, 2121, 37530, 1470, 37531, 41195, 1469, 37528, 40968, 37525, 40369, 40371, 40619, 40622, 48155, 40628, 40624, 40620, 2010, 40365, 40391, 40389, 40372, 40378, 40422, 40395, 40617, 48150, 40352, 48151, 40415, 48159, 40621, 48122, 40416, 48158, 40377, 40614, 40368, 40379, 40376, 40412, 40626, 48149, 40408, 48146, 40399, 40401, 40407, 48148, 40384, 48157, 40413, 40424, 40370, 40417, 2009, 40423, 40373, 48147, 40382, 48154, 40383, 40404, 40385, 40400, 40392, 40616, 40397, 40398, 40375, 40623, 40362, 40403, 40381, 40393, 40363, 40394, 4100, 40396, 40354, 40367, 40353, 40409, 40361, 40410, 40414, 40419, 48153, 48156, 40627, 40411, 40402, 40387, 40406, 40388, 40615, 2012, 48145, 40364, 40374, 40386, 40390, 40380, 40421, 2011, 40366, 40359, 40405, 40418, 40420, 48152, 6092, 7089, 40358, 40674, 40682, 40691, 44659, 46546, 40679, 40683, 40686, 40688, 1367, 41149, 6095, 41153, 40356, 44660, 40672, 48574, 40678, 40689, 41150, 41152, 42729, 45775, 40357, 40680, 40668, 40684, 40671, 40675, 40677, 40681, 40685, 40687, 40690, 41151, 44391, 46545, 48576, 48578, 48580, 48579, 40676, 48582, 6093, 48584, 6836, 40360, 40669, 40670, 40673, 48575, 48577, 48632, 48631, 48581, 48583, 4357, 40514, 40517, 40520, 40524, 40526, 40645, 40664, 40665, 40647, 40523, 40510, 40650, 40512, 40657, 40513, 40660, 40515, 48165, 40519, 48166, 40522, 48163, 40525, 40533, 40527, 40652, 40654, 40656, 40534, 40659, 40535, 40537, 40542, 40629, 40516, 40521, 40648, 40511, 40653, 40658, 40662, 40925, 48164, 48162, 48161, 40649, 40538, 40646, 40530, 40543, 48167, 40655, 40528, 40663, 40531, 48160, 40536, 40541, 40529, 40618, 34235, 40539, 40532, 40540, 40651, 40661, 44631, 40842, 40846, 40840, 40844, 1530, 5916, 40003, 40508, 40919, 2203, 40004, 40507, 40509, 5621, 34794, 34802, 34806, 34810, 3000, 6140, 3001, 6140, 4426, 44713, 3000, 5621, 34332, 34460, 34794, 34802, 34810, 40895, 48522, 44714, 48518, 48519, 40897, 40903, 34806, 40901, 40933, 41218, 40935, 44672, 44715, 44716, 48517, 48520, 48521, 48523, 6186, 6061, 6089, 6190, 6238, 7876, 7933, 4395, 34193, 34645, 34651, 44615, 46040, 34663, 34681, 40932, 41204, 46144, 41205, 46039, 46041, 46042, 47003, 47442, 37030, 4379, 4381, 4382, 5218, 5272, 7722, 37033, 37032, 37031, 37034, 48588, 35821, 37925, 47715, 40909, 40910, 40911, 40912, 40913, 40933, 40935, 41037, 41103, 48663, 47661, 47662, 47671, 47673, 1732, 2231, 3873, 5353, 1730, 40708, 41024, 44670, 34239, 7172, 7169, 6689, 41033, 7376, 3001, 6799, 6061, 6687, 5880, 39126, 40889, 47230, 40984, 7234, 8045, 47233, 40884, 40885, 2005, 6797, 41010, 41219, 47386, 7089, 2001, 2002, 6872, 6873, 1999, 41177, 47003, 6092, 6093, 34193, 34197, 35821, 47727, 35947, 37558, 40987, 40988, 41178, 47233, 47236, 47671, 47673, 1293, 2003, 2005, 2006, 6088, 7935, 1999, 40976, 40977, 41210, 48550, 47233, 35885, 48548, 48552, 44427, 48555, 47601, 48549, 48551, 48553, 48554, 47386, 7376, 1717, 2166, 3591, 3587, 3588, 3590, 6799, 3589, 3586, 6785, 5880, 3585, 7410, 6687, 6802, 7408, 6786, 6784, 6798, 6787, 7409, 34076, 7123, 1528, 1529, 2769, 6801, 7407, 7401, 6797, 7234, 47644, 47648, 47645, 47646, 47647, 5842, 7155, 7629, 8046, 36062, 36063, 2897, 40776, 36066, 43855, 48190, 37964, 36068, 2904, 37965, 39830, 36052, 36051, 36053, 36056, 36060, 1448, 46527, 47374, 48187, 1835, 6641, 48191, 40779, 40778, 36050, 36055, 40777, 48197, 36057, 44581, 36059, 36061, 36064, 36065, 46526, 3859, 48198, 2893, 48199, 36054, 40942, 44569, 48189, 44580, 48200, 2901, 47375, 48194, 36067, 48193, 45512, 48202, 48201, 48196, 48195, 48192, 48188, 48186, 39981, 39986, 44096, 46992, 48221, 2140, 39982, 2884, 39988, 39989, 2898, 39983, 39984, 39985, 39987, 44893, 40002, 46990, 46991, 46993, 47919, 2894, 46852, 5896, 6687, 6691, 41117, 46174, 40960, 40961, 40963, 2138, 41193, 40962, 41021, 41194, 8049, 37014, 1839, 37009, 2023, 37010, 1840, 5277, 2023, 8015, 44425, 37015, 8015, 5732, 41003, 37012, 37013, 37011, 2881, 35821, 2877, 44335, 44336, 44337, 2356, 2355, 44340, 2878, 7947, 47778, 44334, 44338, 44339) AND t.active=1 AND ((colors.color_id='463')) 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)