报错信息是什么?sql没看出问题

解决方案 »

  1.   

    select s.*, g.gradename from student as s left join grade as g on s.gradeid = g.gradeid where s.studentid = $id
      

  2.   

    #1052 - Column 'studentid' in where clause is ambiguous
      

  3.   

    wander_wind  写的正确,可我不明白我的为什么错了
      

  4.   

    Column 'studentid' in where clause is ambiguous 
    在where子句中的 studentid 列是含糊的。在多表查询中,列名带上它的前缀是必须的,否则MySQL分不清楚。
      

  5.   

    select t1.gradename, t2.* from grade as t1,student as t2 where t1.studentid = '$id' and t2.gradeid = t1.gradeid