so i have 2 tables here
CREATE TABLE tblAcctPrd (
strAPCode VARCHAR(50) NOT NULL,
datAPStartDate DATE NOT NULL,
datAPEndDate DATE NOT NULL,
PRIMARY KEY (strAPCode)
)Engine=InnoDB;
which is the parent table and
CREATE TABLE tblEntry ( <----the child table
strEntCode VARCHAR(50) NOT NULL,
datEntDate DATE NOT NULL,
strEntType VARCHAR(50) NOT NULL,
strEntDesc TEXT,
dblEntAmount DOUBLE NOT NULL,
strAPEntCode VARCHAR(50) NOT NULL,
FOREIGN KEY (strAPEntCode) REFERENCES tblAcctPrd (strAPCode) ON DELETE RESTRICT ON UPDATE CASCADE,
PRIMARY KEY(strEntCode)
)Engine=InnoDB;
the preparedstatements for these 2 are on a separate class, tblAcctPrd is for the first page of the gui in java and then when entering all the data at the 2nd page of gui will be recorded in the tblEntry, so the problem here is that it should have only one strAPCode for many strEntCode but I don't know how to do it, also after entering from the first page, all the data that i entered is not recorded on the tblentry
also an error like this show up : strEntCode doesn't have default value error mysql in java when i enter from the java gui page that records to tblAcctPrd