1016 -

SELECT p2c.categories_id FROM products p JOIN products_to_categories p2c ON p.products_id = p2c.products_id AND p2c.categories_id = p.main_category_id LEFT JOIN categories c ON c.categories_id = p2c.categories_id WHERE p.products_id = '1400' AND p.products_status = '1' AND p.products_id = p2c.products_id AND c.categories_status = 1 LIMIT 1

[TEP STOP]