วิธีแก้ MySQL ERROR 1451,1452 Cannot add or update a child row: a foreign key constraint fails
หรืออะไรก็ตามที่มันจะแจ้งว่า a foreign key constraint fails การที่เราสร้าง foreign key ขึ้นมานั้น ตารางที่เราเชื่อมกัน (relation) จะต้องมีข้อมูลที่สัมพันธ์กัน! e.g. ตาราง employee มี {id, name, position} […]