SELECT SQL_CACHE p.id FROM `connections` c INNER JOIN products_categories p ON c.`to_id` = p.id WHERE `from` = 'products' AND `to` = 'products_categories' AND `from_id` = AND `to_id` IN (SELECT id_pt FROM products_categories_lang WHERE active = 1) LIMIT 1
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 'AND `to_id` IN (SELECT id_pt FROM products_categories_lang WHERE active = 1) ' at line 4