Syntax error, unexpected token ), near to ' ORDER BY publication_date DESC LIMIT 1', when parsing: SELECT AS article_id, Articles.slug_fr AS slug_fr, Articles.slug_en AS slug_en, Articles.excerpt_fr AS excerpt_fr, Articles.excerpt_en AS excerpt_en, Articles.text_fr AS text_fr, Articles.text_en AS text_en, Articles.title_fr AS title_fr, Articles.title_en AS title_en, Articles.meta_desc_fr AS meta_desc_fr, Articles.meta_desc_en AS meta_desc_en, Articles.image_fr AS image_fr, Articles.image_en AS image_en, Articles.image_vedette_fr AS image_vedette_fr, Articles.image_vedette_en AS image_vedette_en, Articles.formatted_image_en_link, Articles.formatted_image_fr_link, Articles.formatted_image_vedette_en_link, Articles.formatted_image_vedette_fr_link, Articles.category_id AS category_id, ArticleCategories.name_fr AS category_name_fr, ArticleCategories.name_en AS category_name_en, ArticleCategories.special_category AS category_special_category, AgenciesArticles.agency_id AS agency_id, AgenciesArticles.publication_date AS publication_date, AgenciesArticles.en_vedette AS en_vedette FROM Articles LEFT JOIN AgenciesArticles ON = AgenciesArticles.article_id LEFT JOIN Agencies ON AgenciesArticles.agency_id = LEFT JOIN ArticleCategories ON Articles.category_id = WHERE (en_vedette = 1 AND category_id = 1 AND publication_date <= CURDATE() AND agency_id = ) ORDER BY publication_date DESC LIMIT 1 (1715)