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