调试CakePHP保存

So, I wrote a CakePHP 3.3 app that has a "Users" table and a "UserProfiles" table, and I cannot for the life of me figure out why my code stopped working when I transferred the project from my personal development environment to our hosting servers. I was using the most recent MySQL 5.7 in building, and now my host is reporting my database is Percona 5.5.51-38.2-log. Essentially, I believe the UserProfile fails to save because it cannot find the user created. The error I'm receiving on save is:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`staging`.`user_profiles`, CONSTRAINT `fk_user_profiles_users` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)

I logged the queries and my last runs show the following statements in logs\debug.log:

2016-11-22 23:13:40 Debug: duration=1 rows=1 SELECT Users.id AS `Users__id`, Users.email AS `Users__email`, Users.password AS `Users__password`, Users.role AS `Users__role`, Users.created AS `Users__created`, UserProfiles.user_id AS `UserProfiles__user_id`, UserProfiles.address_one AS `UserProfiles__address_one`, UserProfiles.address_two AS `UserProfiles__address_two`, UserProfiles.age AS `UserProfiles__age`, UserProfiles.sex AS `UserProfiles__sex`, UserProfiles.first_name AS `UserProfiles__first_name`, UserProfiles.last_name AS `UserProfiles__last_name`, UserProfiles.city AS `UserProfiles__city`, UserProfiles.state AS `UserProfiles__state`, UserProfiles.zip AS `UserProfiles__zip`, UserProfiles.phone AS `UserProfiles__phone`, UserProfiles.photo AS `UserProfiles__photo` FROM users Users LEFT JOIN user_profiles UserProfiles ON Users.id = (UserProfiles.user_id) LIMIT 20 OFFSET 0
2016-11-22 23:13:40 Debug: duration=0 rows=1 SELECT (COUNT(*)) AS `count` FROM users Users LEFT JOIN user_profiles UserProfiles ON Users.id = (UserProfiles.user_id)
2016-11-22 23:13:44 Debug: duration=0 rows=0 BEGIN
2016-11-22 23:13:44 Debug: duration=0 rows=0 SELECT 1 AS `existing` FROM users Users WHERE Users.email = 'admin1@domain.com' LIMIT 1
2016-11-22 23:13:44 Debug: duration=0 rows=1 INSERT INTO users (email, password, role) VALUES ('admin1@domain.com', 'y$Gak.CvDbw7Jg8gwbEGBiNeVdj7L8i3xScNOoDBegU7DP5aU6A8Ns2', 'admin')
2016-11-22 23:13:44 Debug: duration=0 rows=0 SELECT 1 AS `existing` FROM user_profiles UserProfiles WHERE UserProfiles.user_id = 11 LIMIT 1
2016-11-22 23:13:44 Debug: duration=0 rows=1 SELECT 1 AS `existing` FROM users Users WHERE Users.id = 11 LIMIT 1
2016-11-22 23:13:44 Debug: duration=0 rows=0 INSERT INTO user_profiles (user_id, address_one, address_two, age, sex, first_name, last_name, city, state, zip, phone, photo) VALUES (11, 'Test Place 42', 'Teeeeeeest', 24, 'm', 'Kyle', 'Person', 'Place', 'FL', '12312', '1231231234', '')
2016-11-22 23:13:44 Debug: duration=0 rows=0 ROLLBACK

So, it appears that the INSERT INTO user_profiles statement is correctly picking up the id of the user (11 in this case), but everything I've read on the internet says that it probably cannot find a user by id 11. CakePHP is being a pain in my *** and hiding the variable data in code from me in the error, saying my SQL query is:

INSERT INTO user_profiles (user_id, address_one, address_two, age, sex, first_name, last_name, city, state, zip, phone, photo) VALUES (:c0, :c1, :c2, :c3, :c4, :c5, :c6, :c7, :c8, :c9, :c10, :c11)

So if anyone knows how to read those "c variables", that would go a long way in helping, I'd imagine. I'm not great with debugging, so feel free to recommend any method I could use to further my productivity.

This is the SQL code for constructing the two tables:

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';

CREATE SCHEMA IF NOT EXISTS `staging` DEFAULT CHARACTER SET utf8 ;
USE `staging` ;

DROP TABLE IF EXISTS `staging`.`users` ;

CREATE TABLE IF NOT EXISTS `staging`.`users` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `email` VARCHAR(255) NOT NULL,
  `password` VARCHAR(128) NOT NULL,
  `role` ENUM('admin', 'vet', 'client') NOT NULL,
  PRIMARY KEY (`id`));

DROP TABLE IF EXISTS `staging`.`user_profiles` ;

CREATE TABLE IF NOT EXISTS `staging`.`user_profiles` (
  `user_id` INT NOT NULL,
  `address_one` VARCHAR(255) NULL,
  `address_two` VARCHAR(255) NULL,
  `age` INT NULL,
  `sex` ENUM('m', 'f') NULL,
  `first_name` VARCHAR(45) NULL,
  `last_name` VARCHAR(45) NULL,
  `city` VARCHAR(45) NULL,
  `state` VARCHAR(45) NULL,
  `zip` VARCHAR(6) NULL,
  `phone` VARCHAR(45) NULL,
  `photo` VARCHAR(255) NULL,
  PRIMARY KEY (`user_id`),
  INDEX `fk_user_profiles_users2_idx` (`user_id` ASC),
  CONSTRAINT `fk_user_profiles_users`
    FOREIGN KEY (`user_id`)
    REFERENCES `staging`.`users` (`id`)
    ON DELETE CASCADE
    ON UPDATE CASCADE)
ENGINE = InnoDB;

SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

And this was generated by MySQLWorkbench.

Thank you so much for your time and help!

This is no longer a PHP issue. Going to dismiss my question for now.