WordPress database error: [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 benPla_posts.ID NOT IN ("SELECT object_id FROM benPla_...' at line 19]SELECT COUNT( DISTINCT benPla_posts.ID ) as term_count, GROUP_CONCAT(DISTINCT benPla_posts.ID SEPARATOR ',') as PID, terms.term_id as term_count_id FROM benPla_posts
INNER JOIN benPla_term_relationships AS term_relationships ON benPla_posts.ID = term_relationships.object_id
INNER JOIN benPla_term_taxonomy AS term_taxonomy USING( term_taxonomy_id )
INNER JOIN benPla_terms AS terms USING( term_id )
LEFT JOIN benPla_term_relationships ON (benPla_posts.ID = benPla_term_relationships.object_id) LEFT JOIN benPla_term_relationships AS tt1 ON (benPla_posts.ID = tt1.object_id)
WHERE benPla_posts.post_type IN ( 'product' )
AND benPla_posts.post_status='publish'
AND (
benPla_posts.ID NOT IN (
SELECT object_id
FROM benPla_term_relationships
WHERE term_taxonomy_id IN (7)
)
AND
benPla_term_relationships.term_taxonomy_id IN (127)
AND
tt1.term_taxonomy_id IN (127)
)
AND terms.term_id IN ()
AND benPla_posts.ID NOT IN ("SELECT object_id FROM benPla_term_relationships WHERE term_taxonomy_id='7'") AND ((terms.term_id IN (175, 15, 18, 153, 154, 155, 19, 156, 157, 158, 20, 160, 161, 21, 149, 150, 151, 152, 22, 144, 143, 127))) GROUP BY terms.term_id