I have duplicated (copied) a table and for some reason Primary Keys wasnt added.
Now I have a lot of new records were added recently with 0 value in the id field. All the previous records does have a unique ID (from 1 to 302979).
How to fix this?
#1062 - Duplicate entry '0' for key 'PRIMARY'
AUTO_INCREMENT wasnt added as well.
CREATE TABLE `result` (
`id` int(11) NOT NULL DEFAULT '0',
`status` varchar(50) NOT NULL,
`status_date` datetime NOT NULL,
`member_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
try
to correct the wrong
ids.then add
auto_incrementto your tableand then use
in which you replace
1234with the number you want to start your increment value. It can be the highest id + 1 for instance. You could get that number with