I am sending applicant_id as 0
Do you have a record in the related table with this id?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have 3 tables
applicant_profiles - having id as primary key user_profiles - having id as primary key
users table - having applicant_id and user_id as Foreign keys ,
now if I insert into the users table , I encountered the following error.
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails - FK_Applicant_ID
I am sending applicant_id as 0 and user_id from user_profiles table
Please or to participate in this conversation.