SELECT COUNT(news_id) as totalCount FROM sys_news_events WHERE 1=1 AND sys_news_events.news_live = 1 AND sys_news_events.news_id <> 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 '' at line 1