In my MySQL database I have two tables: customers and feedbacks
Values come from a small php app.
To show to which customer a feedback record belongs, I want to insert the values of customers.customerID into feedbacks.customerID
Only single column (customer.customerID) into (feedback.cutomerID).
Here is the DDL
@strawbery
-- Table structure for table `customers`
--
CREATE TABLE IF NOT EXISTS `customers` (
`customerID` int(20) NOT NULL AUTO_INCREMENT,
`compid` varchar(5) DEFAULT NULL,
`store` varchar(10) DEFAULT NULL,
`name` varchar(10) DEFAULT NULL,
`contact` varchar(15) DEFAULT NULL,
`email` varchar(15) DEFAULT NULL,
`gender` varchar(7) DEFAULT NULL,
`age` int(3) DEFAULT NULL,
`fbdate` varchar(10) DEFAULT NULL,
`sysip` varchar(15) DEFAULT NULL,
PRIMARY KEY (`customerID`),
UNIQUE KEY `customerID` (`customerID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
CREATE TABLE IF NOT EXISTS `feedback` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`customerID` int(20) NOT NULL,
`design` varchar(10) NOT NULL,
`variety` varchar(10) NOT NULL,
`fabric` varchar(10) NOT NULL,
`stitch` varchar(10) NOT NULL,
`size` varchar(10) NOT NULL,
`service` varchar(10) NOT NULL,
`experience` varchar(10) NOT NULL,
`recommend` varchar(20) NOT NULL,
`comments` varchar(50) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK_feedback` (`customerID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
regards