Incorrect use of DEFAULT NULL?
I have a create script as follows:
CREATE TABLE `log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`timestamp` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`machine_id` int(11) NOT NULL,
`event` text NOT NULL,
`login_id` int(11) DEFAULT NULL,
`usage` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
)
ENGINE=InnoDB AUTO_INCREMENT=1896 DEFAULT CHARSET=latin1;
When I run this insert statement:
INSERT INTO log VALUES("0","1483766635","115","60","Rejected","","0")
I get:
Error Code: 1366.
Incorrect integer value: '' for column 'login_id' at row 1
I am obviously using DEFAULT NULL wrong or maybe I should use something else? When I take login_id value out of the statement I get a value count error.
login_id value is almost always null.
What is best/better way to do this? Many thanks