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