Ошибка БД

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND `category_id` IS NULL ORDER BY rand() LIMIT 3' at line 7

SELECT SQL_CALC_FOUND_ROWS pd.id, p.alias, p.nice_alias, p.name_0 as name, p.store, pd.image, p.price, p.type, pd.short_0 as short, pd.body_0 as body, ct.name_0 as catname, pd.rank, pd.marker, pd.marker_delivery, pd.marker_discount, pd.marker_iq, pd.marker_partpay FROM (prod p) LEFT JOIN prod_description pd ON p.alias=pd.alias LEFT JOIN cats ct ON p.type=ct.alias WHERE `p`.`type` = 'zapchasti' AND `pd`.`id` != AND `category_id` IS NULL ORDER BY rand() LIMIT 3