MySQL 'user_id' in where clause is ambiguous problem

后端 未结 4 1659
逝去的感伤
逝去的感伤 2020-11-28 16:49

How can I correct the problem I keep getting from the code below which states \'user_id\' in where clause is ambiguous. Thanks for the help in advance.

4条回答
  •  隐瞒了意图╮
    2020-11-28 16:50

    You should be mention alias name of your column and assign to user_id like

    SELECT user.*, user_info.* 
    FROM user as u 
    INNER JOIN user_info as ui ON u.user_id = ui.user_id
    WHERE u.user_id='$user_id'
    

提交回复
热议问题