2014-11-26 03:00:03 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, 37530, 2121, 37531, 1470, 41195, 1469, 37528, 40968, 37525, 2010, 40365, 40389, 40378, 40422, 40395, 48150, 40352, 40415, 40369, 40621, 40371, 40416, 40622, 40377, 40619, 40368, 48155, 40379, 40628, 40412, 40624, 40376, 40620, 40623, 40626, 40362, 48149, 40381, 40408, 40363, 48146, 4100, 40401, 40367, 48148, 40353, 40384, 40361, 40424, 40370, 40391, 2009, 40372, 40373, 40617, 40382, 48151, 40383, 48159, 40404, 48122, 40400, 48158, 40385, 40614, 40387, 40616, 40388, 40392, 2012, 40397, 40364, 40398, 40374, 40375, 40386, 40403, 40390, 40393, 40380, 40394, 40396, 40399, 40354, 40407, 40409, 48157, 40410, 40413, 40414, 40417, 40419, 40423, 48147, 48153, 48154, 40421, 48156, 40366, 40627, 2011, 40411, 40359, 40402, 40405, 40406, 40418, 40615, 40420, 48145, 48152, 1367, 6092, 6095, 7089, 40356, 40358, 40672, 40674, 40678, 40682, 40689, 40691, 41152, 44659, 41150, 46546, 40676, 42729, 6093, 45775, 6836, 40680, 40357, 40360, 40668, 40669, 40684, 40670, 40671, 40673, 40675, 40677, 40679, 40681, 40683, 40685, 40686, 40687, 40688, 40690, 41149, 41151, 41153, 44391, 44660, 46545, 48574, 48575, 48576, 48577, 48578, 48632, 48580, 48631, 48579, 48581, 48582, 48583, 48584, 40510, 40511, 40512, 40513, 40514, 40515, 40517, 40519, 40520, 40522, 40524, 40525, 40526, 40533, 40645, 40652, 40664, 40527, 40665, 40646, 40654, 40530, 40656, 48167, 40659, 40528, 40534, 40531, 40535, 40536, 40537, 40541, 40542, 40618, 40629, 40516, 40647, 40521, 40523, 40648, 40650, 40653, 40657, 40658, 40660, 40662, 48165, 40925, 48166, 48164, 48163, 40529, 48162, 40539, 48161, 34235, 40649, 40532, 40538, 40540, 40543, 40651, 40655, 40661, 40663, 44631, 48160, 4357, 1530, 2203, 5916, 40004, 40003, 40507, 40508, 40509, 40919, 40840, 40842, 40844, 40846, 3000, 5621, 6140, 3001, 34794, 34802, 34806, 34810, 6140, 3000, 5621, 34794, 34802, 34810, 40895, 48522, 44714, 48518, 48519, 44713, 40897, 40903, 4426, 41218, 34332, 34460, 44716, 34806, 40901, 40933, 40935, 44672, 44715, 48517, 48520, 48521, 48523, 6190, 34193, 6238, 7933, 6186, 6061, 44615, 7876, 46040, 4395, 34651, 46144, 34645, 34663, 6089, 34681, 40932, 41205, 41204, 46041, 46039, 46042, 47003, 47442, 5218, 7722, 5272, 48588, 4381, 37033, 4382, 47715, 37032, 37031, 37034, 35821, 4379, 37925, 40909, 40911, 40910, 37030, 40935, 40912, 41037, 40913, 40933, 41103, 47661, 47662, 47671, 48663, 47673, 2231, 3873, 5353, 1730, 40708, 41024, 1732, 44670, 34239, 7172, 7169, 6689, 41033, 6061, 7376, 6687, 3001, 6799, 5880, 39126, 47386, 47230, 40984, 7234, 40889, 47233, 40884, 8045, 2005, 40885, 6797, 41010, 41219, 47386, 7089, 2002, 2001, 41177, 47003, 1999, 6093, 6872, 6873, 34197, 6092, 34193, 47727, 35821, 35947, 37558, 40987, 40988, 41178, 47673, 47233, 47236, 47671, 2005, 2006, 6088, 40976, 40977, 2003, 48550, 1999, 41210, 47233, 1293, 48548, 48552, 7935, 35885, 48555, 44427, 47601, 48549, 48551, 48553, 48554, 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, 44340, 2355, 47778, 2878, 7947, 44334, 44338, 44339) AND t.active=1 AND ((colors.color_id='432')) 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)