2017-02-15 47 views
-1

請我可以得到一些幫助,我不知道爲什麼這個準備好的聲明不起作用我如何準備多個左連接的mysql語句?

prepare("SELECT articles.id_article, articles.name_article, articles.object, articles.photo, articles.category_category_id, articles.date_entred articles.views, category.name as category, auteur.name as auteur 
    FROM articles 
    LEFT JOIN category 
     ON category_id = category_category_id 
    LEFT JOIN auteurs 
     ON id_auteurs = auteurs_id_auteurs 
    WHERE articles.id_article = ? 
    GROUP BY articles.id_article 
    ", [$id], __CLASS__); 
+0

whats完整的代碼? – nogad

+1

你在用什麼驅動程序?錯誤報告顯示什麼?通常你用'bind'或'execute'函數綁定這個值。 – chris85

+1

你的目標是什麼?你得到的錯誤是什麼? –

回答

1

問題: articles.date_entred articles.views

應該是: articles.date_entred, articles.views

而且entred或許應該改變到entered ...除非entred是外來詞我不知道

+0

謝謝,很多,下次我會更加car。。 –