Array ( [0] => 00000 [1] => [2] => )
SELECT products.id, (select count(*) as count from wcd_yt_rate where id_item = products.id and rate = 2) as dislikes, (select count(*) as count from wcd_yt_rate where id_item = products.id and rate = 1) as likes, (select rate from `wcd_yt_rate` where id_item = products.id and ip = '54.234.247.118') as ratingAction, (select ni.filename from products_images ni where ni.contId = products.id order by ismain desc, position asc limit 1) as filename, (select ni.alt from products_images ni where ni.contId = products.id order by ismain desc, position asc limit 1) as alt, i18n.title as title, i18n.textCleared, cat.title as parentName, products.url, IF( products.adate < products.pdate, products.pdate, products.adate ) AS adate, c.url as categoryUrl, products.viewed, products.comments, i18n.text, m.name as manName, m.img as manImg, price, new_price FROM products LEFT JOIN manufacturers m on m.id = products.manufactureId LEFT JOIN categories as c on c.id = products.categoryId LEFT JOIN products_i18n i18n on i18n.productsId = products.id AND i18n.i18nId = 1 LEFT JOIN categories_i18n as cat on cat.categoryId = products.categoryId AND cat.i18nId = 1 WHERE ( products.categoryId = OR products.categories like '%##%' ) AND products.isactive = 1 GROUP by products.id ORDER BY products.new_price desc, products.id desc