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 agent_blog_articles.blog_category_id = 292 order by published desc limit 1' at line 3SELECT agent_blog_articles.*, agent_blog_categories.title as category from agent_blog_articles JOIN agent_blog_categories on (agent_blog_articles.blog_category_id = agent_blog_categories.blog_category_id) where agent_blog_articles.display = "1" AND agent_blog_articles.site_id = and agent_blog_articles.blog_category_id = 292 order by published desc limit 1