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 'AND p.in_stock = 1 ORDER BY b.title ASC' at line 4

SELECT DISTINCT(p.brand_id) AS brand_id, b.title FROM `products` AS p LEFT JOIN `brand` AS b ON p.brand_id = b.brand_id WHERE p.category_id = AND p.in_stock = 1 ORDER BY b.title ASC ;

Filename: models/Model_functions.php

Line Number: 5