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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.