ERROR - MySql Query

FILE: /var/www/html/onestore.lynx2000.it/v2/application/filter/filter.model.php

LINE: 304

QUERY: SELECT COUNT(j.category_id) AS tot, j.category_id FROM lnk_category_product j LEFT JOIN tbl_product p ON p.product_id = j.product_id LEFT JOIN tbl_category c ON j.category_id = c.category_id WHERE p.is_visible = 1 AND c.is_visible = 1 AND ( p.brand_id = ) GROUP BY j.category_id

ERROR: [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 ') GROUP BY j.category_id' at line 8