MySQL 'user_id' in where clause is ambiguous problem

后端 未结 4 1657
逝去的感伤
逝去的感伤 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 17:10

    Try this.

    SELECT u.user_id, u.user_fudge, ui.foo, ui.bar
    FROM user AS u
    INNER JOIN user_info AS ui
       ON ui.user_id = u.user_id
    WHERE u.user_id = '$user_id';
    

提交回复
热议问题