Reputation: 542
When I run the following query on phpmyadmin then it gives me following error
INSERT INTO `infrastructure_support_info`(`s_no`, `student_no`, `books_availability`, `basic_requirements`, `technological_support`, `study_material`, `resource_availability`, `cleaniliness_of_class`)
VALUES ('', '', '$availabilityOfBooks', '$basicRequirements', '$technologicalSupport', '$photocopyOfStudyMaterial', '$availabilityOfOtherResources', '$cleanlinessOfClass')
#1452 - Cannot add or update a child row: a foreign key constraint fails (
feedback_system_db
.infrastructure_support_info
, CONSTRAINTuser_std_no
FOREIGN KEY (student_no
) REFERENCESuser_master
(student_no
))
Upvotes: 0
Views: 24
Reputation: 204756
Your table has a reference to another one. If you want to leave that link empty then use null
instead of a blank string ''
.
Upvotes: 2