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 'and trim_id in
(select trim_id from products where manufacturers_id in (se' at line 1
select distinct trim_name from trims where model_id = and trim_id in
(select trim_id from products where manufacturers_id in (select manufacturers_id from manufacturers where manufacturers_disabled = 0) and products_id in (select products_id from products_to_categories where categories_id in
(select categories_id from categories where parent_id=4 and categories_id=504))) order by trim_name