I'm not sure what I am doing wrong here. I have a table with 8 columns and the first is a primary, auto increment key. I am entering rows manually from the interface. I add one row in just fine. When I add in the second row, it says "SQL Error (1062): Duplicate entry '0' for key 'PRIMARY'" the generated sql code in the bottom pane does not have the primary key in it. Here is the SQL code:
INSERT INTO brochures
(Name
, DBName
, Year
, Description
, Featured
, Order
) VALUES ('Simply Spring', 'SimplySpring', '2016', 'Our biggest shopper brochure with an extensive list of products for everyone. ', '1', '1');
adding a new row, getting duplicate error
Just remembered I was still having this issue. Here is my create code:
CREATE TABLE `brochures` (
`BrochureID` SMALLINT(4) UNSIGNED NOT NULL,
`Name` VARCHAR(50) NOT NULL COLLATE 'utf8_general_ci',
`DBName` VARCHAR(50) NOT NULL COLLATE 'utf8_general_ci',
`Year` SMALLINT(5) UNSIGNED NOT NULL,
`Description` VARCHAR(250) NOT NULL COLLATE 'utf8_general_ci',
`Active` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
`Featured` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
`Order` TINYINT(3) UNSIGNED NOT NULL,
PRIMARY KEY (`BrochureID`),
INDEX `Index 2` (`BrochureID`)
)
COLLATE='utf8mb4_unicode_ci'
ENGINE=MyISAM
;
Please login to leave a reply, or register at first.