Thursday, March 2, 2017

Laravel error - QueryException in Connection.php line 729:

Receiving this error:

QueryException in Connection.php line 729:
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`test`.`projects`, CONSTRAINT `projects_am_id_foreign` FOREIGN KEY (`am_id`) REFERENCES `employees` (`id`)) (SQL: insert into `projects` (`company`, `stage`, `status`, `jira`, `notes`, `updated_at`, `created_at`) values (Test, Waiting for Launch, In Progress, https://www.test.com, Testing, 2017-03-02 14:46:47, 2017-03-02 14:46:47))

Projects Table id company am_id etc etc

Employees Table id name department

I have the values in the other table so not sure why it can't reference them. Any ideas?




via robk27

Advertisement