Mình bị lỗi này mong các pro giúp đỡ
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (laravel_demo
.tintuc
, CONSTRAINT tintuc_idloaitin_foreign
FOREIGN KEY (idLoaiTin
) REFERENCES loaitin
(id
)) (SQL: delete from LoaiTin
where id
= 4)
Khi mình click xóa bản tin trong danh sách tin thì bị lỗi này. Không biết giữa bảng loaitin và bảng theloai có ràng buộc khóa thế nào. Mong các bạn chỉ giúp.
Cảm ơn nhiều!