Database Error
SQL: SELECT
p.products_image, pd.products_name, m.manufacturers_name,
p.products_id,
p.manufacturers_id,
p.products_price,
p.products_model,
p.products_casesize,
p.products_casetype,
p.products_case_sale_only,
pd.products_name,
pd.products_child_name,
p.products_quantity,
p.products_stock_type,
p.products_tax_class_id,
p.products_is_child,
p.products_is_master,
pd.products_child_name,
apd.category_sales_rank,
IF(apd.category_sales_rank = 0, 99999, apd.category_sales_rank) AS salesrank,
apd.num_reviews,
apd.avg_review_score,
apd.num_views_7_days,
apd.num_sold_7_days,
IF(p.products_date_added != '0000-00-00 00:00:00', p.products_date_added, p.products_last_modified) AS products_date_added,
SUM(t.tag_weight) AS weighting,
IF(m.manufacturers_id IS NULL, 'new', m.manufacturers_url_safe_name) AS manufacturers_url_safe_name,
pd.products_url_safe_name,
p.products_date_available,
p.products_image,
p.products_status,
p2c.categories_id,
IF(p2c.featured = 1, -1,
IF(p2c.products_categories_order > 0, p2c.products_categories_order,
IF(p.products_date_available > DATE_ADD(NOW(), INTERVAL 7 DAY), 5000,
IF(s.specials_id IS NOT NULL, 3000,
IF(p.products_casesize > 0, 2000,
IF(pxt_new.tag_id IS NOT NULL, 1000, 4500)
)
)
)
)
) AS products_position,
tr.tax_rate,
IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price,
IF(s.status, s.specials_new_products_price, p.products_price) as final_price
,pic.products_model as productInCatalogue
from products AS p
LEFT JOIN products_description AS pd ON p.products_id = pd.products_id
LEFT JOIN manufacturers AS m ON p.manufacturers_id = m.manufacturers_id
LEFT JOIN product_x_tags AS pt ON p.products_model = pt.model_id
left join product_x_tags AS pxt_new ON p.products_model = pxt_new.model_id AND pxt_new.tag_id = 6001
LEFT JOIN tags AS t ON pt.tag_id = t.tag_id
LEFT JOIN tax_rates AS tr ON p.products_tax_class_id = tr.tax_class_id
LEFT JOIN agg_product_data AS apd ON p.products_id = apd.products_id
LEFT JOIN specials AS s ON p.products_id = s.products_id LEFT JOIN products_to_categories_new AS p2c ON p.products_id = p2c.products_id
LEFT JOIN categories_new AS c ON p2c.categories_id = c.categories_id
LEFT JOIN products_in_catalogue as pic
on pic.products_model = p.products_model
WHERE (( p.products_is_child='0' AND (p.products_carrot ='0' && p.products_status=1 && (p.products_stock_type=2 || p.products_stock_type=1 || p.products_quantity > 0))
AND p.product_shown_on_website = 1 AND
pd.language_id = 1 AND p.products_model NOT LIKE 'CX%' AND c.categories_visible = 1 ) or ( pic.products_model is not null and p.products_is_child <> 1)) AND (( (pd.products_name LIKE '%nut%' OR
p.products_model LIKE '%nut%' OR
m.manufacturers_name LIKE '%nut%' OR
t.tag_description LIKE '%nut%' ) and or and (pd.products_name LIKE '%seed%' OR
p.products_model LIKE '%seed%' OR
m.manufacturers_name LIKE '%seed%' OR
t.tag_description LIKE '%seed%' ) and and and (pd.products_name LIKE '%500g%' OR
p.products_model LIKE '%500g%' OR
m.manufacturers_name LIKE '%500g%' OR
t.tag_description LIKE '%500g%' ) and or and (pd.products_name LIKE '%1kggiftsgiftsgrocerie%' OR
p.products_model LIKE '%1kggiftsgiftsgrocerie%' OR
m.manufacturers_name LIKE '%1kggiftsgiftsgrocerie%' OR
t.tag_description LIKE '%1kggiftsgiftsgrocerie%' ) or (pd.products_name LIKE '%nut%and%or%and%seed%and%and%and%500g%and%or%and%1kggiftsgiftsgrocerie%' OR
p.products_model LIKE '%nut%and%or%and%seed%and%and%and%500g%and%or%and%1kggiftsgiftsgrocerie%' OR
m.manufacturers_name LIKE '%nut%and%or%and%seed%and%and%and%500g%and%or%and%1kggiftsgiftsgrocerie%' OR
t.tag_description LIKE '%nut%and%or%and%seed%and%and%and%500g%and%or%and%1kggiftsgiftsgrocerie%' ) )) AND
pd.language_id = 1 AND
p2c.categories_id IN (69, 46, 122, 75, 91, 319, 116, 79, 110, 70, 85, 329, 331, 71, 73, 74, 201, 103, 123, 76, 93, 104, 124, 99, 92, 105, 125, 78, 106, 126, 107, 98, 96, 287, 127, 108, 128, 129, 109, 95, 130, 131) AND
m.manufacturers_id = 222 AND
t.tag_id = 7015 group by p.products_id order by weighting desc, products_last_modified desc LIMIT 25
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 'or and (pd.products_name LIKE '%seed%' OR
p.products_model LIKE '%seed' at line 64 (1064)
URL: www.ethicalsuperstore.com/rss/search/nut-or-seed-and-500g-or-1kggiftsgiftsgrocerie/groceries-and-everyday/BT-gluten-free-by-biona.rss)
Date: Mon, 20 May 2013 18:53:20 +0100