How can I query using a foreign key in MySQL?

后端 未结 5 1388
暖寄归人
暖寄归人 2020-12-31 03:54

Right now I have a small database with two tables that look something like this:

    users table
    ====================
    id  name   status_id
    1   Bo         


        
5条回答
  •  臣服心动
    2020-12-31 04:22

    Your users table does not have the value of approved in it. It is in your statuses table. When you request status_id you are going to get that value back from that query. You have to do a JOIN ON status_id to make this work out I think. Or do a second query.

提交回复
热议问题