Jump to content

1062 - Duplicate entry '1' for key 1


yoursurrogategod

Recommended Posts

Why am I getting this error? This is my table, I didn't make report_id 'unique' or 'primary', so what gives?

 

CREATE TABLE `daily_monitoring_form` (
 `report_id` int(10) unsigned NOT NULL,
 `department` int(10) unsigned NOT NULL,
 `month_year` date NOT NULL,
 `solution` varchar(100) character set utf8 collate utf8_unicode_ci default NULL,
 `temperature` char(1) character set utf8 collate utf8_unicode_ci default NULL,
 `bottle_1_opened` date default NULL,
 `bottle_1_expired` date default NULL,
 `bottle_2_opened` date default NULL,
 `bottle_2_expired` date default NULL,
 `machine_num` varchar(100) character set utf8 collate utf8_unicode_ci default NULL,
 PRIMARY KEY  (`report_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `daily_monitoring_form`
--
INSERT INTO `daily_monitoring_form` (`report_id`, `department`, `month_year`, `solution`, `temperature`, `bottle_1_opened`, `bottle_1_expired`, `bottle_2_opened`, `bottle_2_expired`, `machine_num`) VALUES (1, 5, '2013-01-01', 'Cidex', 'F', '2013-01-02', '2013-01-30', '2013-01-02', '2013-01-30', '12');

 

I tried inserting -- from inside of phpMyAdmin -- a new entry with the same report_id and I got that error, why?

Link to comment
https://forums.phpfreaks.com/topic/273286-1062-duplicate-entry-1-for-key-1/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.