![]() |
#1062 - Duplicate entry '0' for key 'PRIMARY' - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: #1062 - Duplicate entry '0' for key 'PRIMARY' (/showthread.php?tid=59610) Pages:
1
2
|
#1062 - Duplicate entry '0' for key 'PRIMARY' - El Forum - 10-27-2013 [eluser]kaloyan[/eluser] I'm trying to make a database using phpMyAdmin I'm using XAMPP 3.2.1 and CI 2.1.4 Apace and MySQL are started in XAMPP so column "id" is set to Primary (not Null) and column "title" is set to --- (not Null) then when click on Go on the one that's cheched with Ignore (as the Video Tutorial shows), I get this error: "#1062 - Duplicate entry '0' for key 'PRIMARY'" SQL query: Edit Edit INSERT INTO `ci_series`.`test` ( `id` , `title` ) VALUES ( '', 'Some Title' ) MySQL said: Documentation #1062 - Duplicate entry '0' for key 'PRIMARY' Please tell me how to fix it, thank You! #1062 - Duplicate entry '0' for key 'PRIMARY' - El Forum - 10-27-2013 [eluser]Tpojka[/eluser] Is set `autoincrement` for id? #1062 - Duplicate entry '0' for key 'PRIMARY' - El Forum - 10-27-2013 [eluser]kaloyan[/eluser] Glad you asked. Well, that's the point, there is no such option, or I am blind enough to not be able to find it LOL, yes i saw on the tutorial that the speacker is selecting Autoincrement, but there was no such option here...he is showing on Mac I guess, so I thought he's stuff is little bit different and it is not a problem that there is no such option on mine phpAdmin. ..soo teach me master! hahaha #1062 - Duplicate entry '0' for key 'PRIMARY' - El Forum - 10-27-2013 [eluser]Tpojka[/eluser] 1. Make backup of your data. 2. Go to phpmyadmin -> your database and in top menu (Structure, SQL, Search, Query, ..., Triggers) find SQL submenu and try with Code: ALTER TABLE `yourtable` ADD `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY #1062 - Duplicate entry '0' for key 'PRIMARY' - El Forum - 10-27-2013 [eluser]kaloyan[/eluser] #1146 - Table 'ci_series.table' doesn't exist #1062 - Duplicate entry '0' for key 'PRIMARY' - El Forum - 10-27-2013 [eluser]kaloyan[/eluser] I found this: http://stackoverflow.com/questions/5665571/auto-increment-in-phpmyadmin there is one that says: The most current version of phpadmin does not have auto-increment. I tried this: "n phpMyAdmin, navigate to the table in question and click the "Operations" tab. On the left under Table Options you will be allowed to set the current AUTO_INCREMENT value", but then this error appears: Can't copy table to same one! #1062 - Duplicate entry '0' for key 'PRIMARY' - El Forum - 10-27-2013 [eluser]Tpojka[/eluser] Is that production table (with live data) or development one? It would be best to make another table. #1062 - Duplicate entry '0' for key 'PRIMARY' - El Forum - 10-27-2013 [eluser]kaloyan[/eluser] i'm sorry, I don't know what ur talking about...i'll just keep searching and so on... #1062 - Duplicate entry '0' for key 'PRIMARY' - El Forum - 10-27-2013 [eluser]Tpojka[/eluser] 1. Go to your `test` table 2. Go to `Structure` menu 3. Check `id` row 4. Click `Change` (you will not change anything) 5. Save Print screen of given window and upload here image or link of that image #1062 - Duplicate entry '0' for key 'PRIMARY' - El Forum - 10-27-2013 [eluser]kaloyan[/eluser] here |