Jump to content

Помогите! Ошибка при работе поиска.


Rubber Duck

Recommended Posts

При использовании поиска появилась ошибка. Главное все работало и тут на тебе.

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 ') ORDER BY position DESC LIMIT 0,12' at line 28

SELECT SQL_CALC_FOUND_ROWS DISTINCT p.*, pl.`description_short`, pl.`available_now`, pl.`available_later`, pl.`link_rewrite`, pl.`name`,
t.`rate`, i.`id_image`, il.`legend`, m.`name` AS manufacturer_name
,(
SELECT SUM(weight)
FROM ps_search_word sw
LEFT JOIN ps_search_index si ON sw.id_word = si.id_word
WHERE sw.id_lang = 3
AND si.id_product = p.id_product
AND (sw.word LIKE 'sony%')
) as position
FROM ps_product p
LEFT JOIN `ps_product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = 3)
LEFT OUTER JOIN `ps_image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1)
LEFT JOIN `ps_image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = 3)
LEFT JOIN `ps_tax` t ON (p.`id_tax` = t.`id_tax`)
LEFT JOIN `ps_manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`)
LEFT JOIN `ps_category_product` cp ON (cp.`id_product` = p.`id_product`)
LEFT JOIN `ps_category` c ON (c.`id_category` = cp.`id_category`)
WHERE p.id_product IN (
SELECT id_product
FROM ps_search_word sw
LEFT JOIN ps_search_index si ON sw.id_word = si.id_word
WHERE sw.id_lang = 3
AND sw.word LIKE 'sony%'
)
AND p.active = 1
AND c.`active` = 1
AND p.`id_product` IN (18,26,43,45,301,303,308,319,321,323,334,335,56,57,58,108,111,112,113,114,115,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,197,198,200,202,203,204,205,240,241,242,243,244,245,246,247,248,249,268,269,270,271,273,274,275,276,284,285,286,287,288,289,290,293,294,295,296,297,298,299,300,330,333,13,109,30,31,32,33,34,35,36,37,38,39,40,41,42,44,46,47,48,49,50,51,52,53,54,110,250,251,253,316,317,331,332,14,15,55,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,258,259,260,261,264,265,266,267,302,304,305,306,307,309,329,103,104,106,107,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,278,279,280,281,282,283,292,310,311,312,313,314,315,17,19,21,22,23,24,25,27,28,116,206,207,208,209,210,211,212,213,326,327,214,215,325,)
ORDER BY position DESC
LIMIT 0,12

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...