2017-02-15 48 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。。 –