MySQL & PHP - Not unique table/alias

前端 未结 4 1143
攒了一身酷
攒了一身酷 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:50

    The problem seems to be here:

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

    You are trying to join the table grades to itself. You probably meant to join with articles_grades.

提交回复
热议问题