OptiPlex Posted April 22, 2003 Share Posted April 22, 2003 (edited) Never mind.... But, anyone know how to fix this error: Duplicate entry '1' for key 1 It happens when I try to run this query: INSERT INTO ibf_categories (id, position, state, name, description) VALUES('1','1','1','General',''); Edited April 22, 2003 by OptiPlex Link to comment Share on other sites More sharing options...
0 Tim Dorr Veteran Posted April 22, 2003 Veteran Share Posted April 22, 2003 id is a primary key. you're trying to define another row with the id 1, when you have a row with that id already. primary key values have to be unique. Make id auto_increment (assuming it's not already), then use this query: INSERT INTO ibf_categories (position, state, name, description) VALUES('1','1','General',''); Link to comment Share on other sites More sharing options...
0 OptiPlex Posted April 22, 2003 Author Share Posted April 22, 2003 Thanks ;) Link to comment Share on other sites More sharing options...
0 Rathamon Posted April 22, 2003 Share Posted April 22, 2003 optiplex where you get that quiz from? Link to comment Share on other sites More sharing options...
0 OptiPlex Posted April 22, 2003 Author Share Posted April 22, 2003 Here: http://www.bbspot.com/News/2003/01/os_quiz.php Link to comment Share on other sites More sharing options...
Question
OptiPlex
Never mind....
But, anyone know how to fix this error:
It happens when I try to run this query:
INSERT INTO ibf_categories (id, position, state, name, description) VALUES('1','1','1','General','');
Edited by OptiPlexLink to comment
Share on other sites
4 answers to this question
Recommended Posts