Database 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 '/tmp/#sql_4fe_0' at line 1 (1064)
Invalid query: SELECT SQL_CALC_FOUND_ROWS products.*, descr1.product as product, MIN(IF(prices.percentage_discount = 0, prices.price, prices.price - (prices.price * prices.percentage_discount)/100)) as price, GROUP_CONCAT(IF(products_categories.link_type = 'M', CONCAT(products_categories.category_id, 'M'), products_categories.category_id)) as category_ids, products_categories.position, cscart_mailchimp_lists.list_id as mailchimp_list_id, cscart_seo_names.name as seo_name FROM cscart_products as products LEFT JOIN cscart_product_descriptions as descr1 ON descr1.product_id = products.product_id AND descr1.lang_code = 'EN' LEFT JOIN cscart_product_prices as prices ON prices.product_id = products.product_id AND prices.lower_limit = 1 INNER JOIN cscart_products_categories as products_categories ON products_categories.product_id = products.product_id INNER JOIN cscart_categories ON cscart_categories.category_id = products_categories.category_id AND (cscart_categories.usergroup_ids = '' OR FIND_IN_SET(0, cscart_categories.usergroup_ids) OR FIND_IN_SET(1, cscart_categories.usergroup_ids)) AND cscart_categories.status IN ('A', 'H') LEFT JOIN cscart_mailchimp_lists ON cscart_mailchimp_lists.object_id = products.product_id AND cscart_mailchimp_lists.type='p' LEFT JOIN cscart_seo_names ON cscart_seo_names.object_id = products.product_id AND cscart_seo_names.type = 'p' AND cscart_seo_names.dispatch = '' AND cscart_seo_names.lang_code = 'EN' LEFT JOIN cscart_product_popularity as popularity ON popularity.product_id = products.product_id WHERE 1 AND products.company_id = 0 AND (products.usergroup_ids = '' OR FIND_IN_SET(0, products.usergroup_ids) OR FIND_IN_SET(1, products.usergroup_ids)) AND products.status IN ('A') AND prices.usergroup_id IN (0, 0, 1) AND ((1 AND products.product_id IN (379, 378, 377, 376, 375, 374, 372, 370)) AND products.company_id = 0 AND prices.usergroup_id IN (0, 0, 1)) GROUP BY products.product_id ORDER BY popularity.total desc LIMIT 0, 8


Backtrace:
File:/home/gadgetsh/public_html/core/fn.database.php
Line:267
Function:db_error
File:/home/gadgetsh/public_html/core/fn.database.php
Line:29
Function:db_query
File:/home/gadgetsh/public_html/core/fn.catalog.php
Line:6686
Function:db_get_array
File:/home/gadgetsh/public_html/core/fn.init.php
Line:845
Function:fn_get_products
File:/home/gadgetsh/public_html/core/fn.init.php
Line:1233
Function:fn_init_user
File:/home/gadgetsh/public_html/init.php
Line:133
Function:fn_init
File:/home/gadgetsh/public_html/index.php
Line:19
Function:require