0
Friends have this table, when I save a user the following error occurs
Error including in database: Duplicate entry 'first name.last name -1' for key 'PRIMARY'
This is the code. detail in development works, not in production.
CREATE TABLE `usuarios` (
`login` varchar(255) NOT NULL,
`passe` varchar(255) NOT NULL,
`nome` varchar(64) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`active` varchar(1) DEFAULT NULL,
`activation_code` varchar(32) DEFAULT NULL,
`admin_pv` varchar(1) DEFAULT NULL,
`foto` longblob,
`img_user` varchar(256) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `usuarios`
ADD PRIMARY KEY (`login`);
the error message is clear, is trying to enter again the same 'name.surname -1' value for the field that is primary key
– Ricardo Pontual
yeah. but the bank is empty.
– WELLINGTON LEITE
show the command
insert
which you are using. the message is clear, you have certainly tried to include more than once the same record with the same value. See the example here that I did and it does not give error the Insert in the table with this structure: http://sqlfiddle.com/#! 9/9c2797/1– Ricardo Pontual
Solved, the problem was another Insert that had put to another table and there this user was already.
– WELLINGTON LEITE
didn’t you say the message was clear? ;) good luck
– Ricardo Pontual