1064: SELECT count(*) as total_row FROM products p INNER JOIN productcategories pc ON p.category=pc.id INNER JOIN addedfilters ad ON p.id=ad.p_id LEFT JOIN category c ON p.pc=c.id WHERE (ad.s_id=) AND (ad.pc=5001) AND (p.price > 0)
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 (ad.pc=5001) AND (p.price > 0)' at line 6