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 model_id in
(select model_id from products where manufacturers_id=27 a' at line 1
select distinct model_name from models where make_id = and model_id in
(select model_id from products where manufacturers_id=27 and products_status = 1 AND products_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=5 and categories_id=510)))