MySQL & PHP - Not unique table/alias

前端 未结 4 1154
攒了一身酷
攒了一身酷 2021-02-12 12:21

I get the following error listed below and was wondering how do I fix this problem.

Not unique table/alias: \'grades\'

Here is the code I think

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-12 12:52

    I thin that in the $sql2 query the second table isn't grades but article_grades. so it will be:

    "SELECT COUNT(*) 
             FROM grades 
             JOIN articles_grades ON grades.id = articles_grades.grade_id
             WHERE articles_grades.users_articles_id = '$page'"
    

提交回复
热议问题