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 a.haveprice = 1 AND b.buycar LIKE '%|22,386|%'' at line 1
SELECT COUNT(*) AS count FROM ***_enewsshopdd AS a INNER JOIN ***_enewsshopdd_add AS b ON a.ddid = b.ddid WHERE a.userid = AND a.haveprice = 1 AND b.buycar LIKE '%|22,386|%'