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_6e96_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, IF(shared_descr.product_id IS NOT NULL, shared_descr.product, descr1.product) as product, IF(shared_descr.product_id IS NOT NULL, shared_descr.short_description, descr1.short_description) as short_description, IF(shared_descr.product_id IS NOT NULL, IF(shared_descr.short_description = '', shared_descr.full_description, ''), IF(descr1.short_description = '', descr1.full_description, '')) as full_description, IF(shared_descr.product_id IS NOT NULL, shared_descr.meta_keywords, descr1.meta_keywords) as meta_keywords, IF(shared_descr.product_id IS NOT NULL, shared_descr.meta_description, descr1.meta_description) as meta_description, IF(shared_descr.product_id IS NOT NULL, shared_descr.search_words, descr1.search_words) as search_words, IF(shared_prices.product_id IS NOT NULL, MIN(shared_prices.price), MIN(prices.price)) as price, cscart_seo_names.name as seo_name FROM cscart_products as products LEFT JOIN cscart_product_options_inventory as inventory ON inventory.product_id = products.product_id 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_ult_product_descriptions shared_descr ON shared_descr.product_id = products.product_id AND shared_descr.company_id = 5 AND shared_descr.lang_code = 'EN' LEFT JOIN cscart_ult_product_prices as shared_prices ON shared_prices.product_id = products.product_id AND shared_prices.lower_limit = 1 AND shared_prices.usergroup_id IN (0, 0, 1) AND shared_prices.company_id = 5 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' AND cscart_seo_names.company_id = 5 WHERE 1 AND cscart_categories.company_id = 5 AND IF(products.tracking = 'O', inventory.amount > 0, products.amount > 0) AND (products.timestamp >= 1403650707 AND products.timestamp <= 1406242707) 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) GROUP BY products.product_id ORDER BY products.timestamp desc LIMIT 0, 30


Backtrace:

File:/home/babycity/public_html/core/fn.database.php
Line:267
Function:db_error
File:/home/babycity/public_html/core/fn.database.php
Line:29
Function:db_query
File:/home/babycity/public_html/core/fn.catalog.php
Line:6837
Function:db_get_array
File:/home/babycity/public_html/core/classes/bm/block.php
Line:754
Function:fn_get_products
File:/home/babycity/public_html/core/classes/bm/render_manager.php
Line:415
Function:get_items
File:/home/babycity/public_html/core/classes/bm/render_manager.php
Line:315
Function:get_value
File:/home/babycity/public_html/core/classes/bm/render_manager.php
Line:252
Function:render_block_content
File:/home/babycity/public_html/core/classes/bm/render_manager.php
Line:202
Function:render_block
File:/home/babycity/public_html/core/classes/bm/render_manager.php
Line:175
Function:render_blocks
File:/home/babycity/public_html/core/classes/bm/render_manager.php
Line:172
Function:_render_grid
File:/home/babycity/public_html/core/classes/bm/render_manager.php
Line:151
Function:_render_grid
File:/home/babycity/public_html/core/classes/bm/render_manager.php
Line:123
Function:_render_container
File:/home/babycity/public_html/core/smarty_plugins/function.render_location.php
Line:41
Function:render
File:/home/babycity/public_html/var/cache/templates/stores/5/customer/basic/%%45^45E^45E480CD%%index.tpl.php
Line:477
Function:smarty_function_render_location
File:/home/babycity/public_html/lib/smarty/Smarty.class.php
Line:1265
Function:include
File:/home/babycity/public_html/lib/smarty/Smarty.class.php
Line:1108
Function:fetch
File:/home/babycity/public_html/core/classes/smarty_engine/core.php
Line:226
Function:display
File:/home/babycity/public_html/core/fn.control.php
Line:578
Function:display
File:/home/babycity/public_html/index.php
Line:22
Function:fn_dispatch