insert record behavior problem
Although it might be a mysql problem, I'm not sure. I'm using the in-built Insert Record Behavior in DMWCS4 to upload data from an online form direct to a MySWQL db table which I've set up via phpMyAdmin on the server. The SQL for the db table is below:
CREATE TABLE `tablename` (
`compid` int(11) NOT NULL AUTO_INCREMENT,
`Title` varchar(55) DEFAULT NOT NULL,
`Firstname` varchar(55) DEFAULT NULL,
`Surname` varchar(55) DEFAULT NULL,
`Company` varchar(55) DEFAULT NULL,
`Add1` varchar(55) DEFAULT NULL,
`Add2` varchar(55) DEFAULT NULL,
`Town` varchar(55) NOT NULL,
`City` varchar(55) DEFAULT NULL,
`Postcode` varchar(55) DEFAULT NULL,
`County` varchar(55) DEFAULT NULL,
`Telephone` varchar(55) DEFAULT NULL,
`Fax` varchar(55) DEFAULT NULL,
`Email` varchar(55) DEFAULT NULL,
`Do not contact marker` enum('y','n') NOT NULL DEFAULT 'n',
PRIMARY KEY (`compid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
the problem I'm having is that when the form is submitted, the Firstname column is blank in the db, regardless of what's entered on the form. I've tried changing this line:
`Firstname` varchar(55) DEFAULT NULL,
to
`Firstname` varchar(55) NOT NULL,
but when I test the form out using MAMP I get the error message "Column 'Firstname' cannot be null"
I have no idea why this is happening – if I leave the Firstname column as DEFAULT NULL I get no first names in the db table, but it won't let me change it – any and all ideas about what's going on here would be greatly appreciated. Thanks in advance.
