“Integrity constraint violation: 1062 Duplicate entry” - but no duplicate rows
问题 I'm converting an app from native mysqli calls to PDO. Running into an error when attempting to insert a row into a table with a foreign key constraint. Note: this is a simplified test case and should not be copy/pasted into a production environment. Info PHP 5.3, MySQL 5.4 First, here are the tables: CREATE TABLE `z_one` ( `customer_id` int(10) unsigned NOT NULL DEFAULT '0', `name_last` varchar(255) DEFAULT NULL, `name_first` varchar(255) DEFAULT NULL, `dateadded` datetime DEFAULT NULL,