Integrity constraint violation: 1452 Cannot add or update a child row:

前端 未结 12 1282
眼角桃花
眼角桃花 2020-11-27 05:32

I am trying to insert values into my comments table and I am getting a error. Its saying that I can not add or update child row and I have no idea what that means.

m

12条回答
  •  借酒劲吻你
    2020-11-27 06:11

    If you are adding new foreign key to an existing table and the columns are not null and not assigned default value, you will get this error,

    Either you need to make it nullable or assign default value, or delete all the existing records to solve it.

提交回复
热议问题