A Database Error Occurred

Error Number: 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 ') as category_count FROM t_product_categories c left join t_pages p on c.categor' at line 1

SELECT c.*,p.url as category_url, (SELECT count(id) as category_count FROM t_assoc where table_ref1 = 't_products' and table_ref2 = 't_product_categories' and item_id2=c.id and item_id1=) as category_count FROM t_product_categories c left join t_pages p on c.category_page_url = p.id where c.active = 1 and c.id in (select item_id2 FROM t_assoc where table_ref1 = 't_products' and table_ref2 = 't_product_categories' and item_id2=c.id and item_id1=) order by c.priority,c.title,c.id desc

Filename: models/Basicmodel.php

Line Number: 665