Question
when a new entry is submitted to my database, the foreign key isn't updating. Unsure of what to change. My create code is CREATE TABLE
when a new entry is submitted to my database, the foreign key isn't updating. Unsure of what to change. My create code is CREATE TABLE `customer_table` ( `customer_ID` int NOT NULL AUTO_INCREMENT, `first_name` varchar(255) DEFAULT NULL, `last_name` varchar(255) DEFAULT NULL, `address` varchar(255) DEFAULT NULL, `city` varchar(255) DEFAULT NULL, `state` varchar(255) DEFAULT NULL, `Zipcode` int DEFAULT NULL, `telephone_number` varchar(13) DEFAULT NULL, PRIMARY KEY (`customer_ID`) ); CREATE TABLE `order_table` ( `order_ID` int NOT NULL AUTO_INCREMENT, `soup_type` varchar(255) DEFAULT NULL, `soup_quantity` int DEFAULT NULL, `delivery` varchar(255) DEFAULT NULL, `customer_ID` int DEFAULT NULL, PRIMARY KEY (`order_ID`), KEY `fk_customer_ID` (`customer_ID`), FOREIGN KEY (customer_ID) REFERENCES customer_table(customer_ID) ON UPDATE CASCADE ON DELETE CASCADE );
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started