core_mysql (error no: 1064) : 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 ') AS `intersection`
)' at line 18 SELECT SQL_CALC_FOUND_ROWS *,
`price` AS `basePrice`,
`promoPrice` AS `basePromoPrice`,
ROUND((IF(`priceVisibility` = "1", (IF(NOW() >= `promoStart` AND NOW() <= `promoStop`, `promoPrice`, `price`)), -1)) * 1.00 *1, 2) AS `price`,
DATE_FORMAT(`promoStart`, "%d-%m-%Y %H:%i") AS `promoStartF`,
DATE_FORMAT(`promoStop`, "%d-%m-%Y %H:%i") AS `promoStopF`,
IF(NOW() >= `promoStart` AND NOW() <= `promoStop`, 1, 0) AS `promoActive`,
(SELECT `accesories` FROM `accesories` WHERE `productId` = `id`) AS `accesories`,
(SELECT COUNT(`id`) FROM `comments` WHERE `productId` = `tblProducts`.`id`) AS `numberOfComments`,
(SELECT `url` FROM `urls` WHERE `id` = `urlId`) AS `url`
FROM `products` AS `tblProducts`
WHERE (`categoryId` = "16" OR `categoryId` IN (SELECT `id` FROM `categories` WHERE `linked` = "16"))
AND
`id` IN (
SELECT `productId` FROM (
) AS `intersection`
)