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 ia.status = "approved" ORDER BY ia.display_order ASC' at line 3 SQL=SELECT ia.* FROM jos_wb_ideas_article ia WHERE ia.ideas_category_id = AND ia.status = "approved" ORDER BY ia.display_order ASC