zoran Posted March 22, 2010 Share Posted March 22, 2010 One of my tables on my forum http://bananarepublika.net/forum seams to have stopped auto incrementing. I have been making some minor changes to the code. My site was also targeted my someone who changed string in the browser to show debateID=0 from a number that was coresponding to the debate. So he put some text in to the database, something silly I dont think it meaters. I have erased some rows from a table that were script injected, I think directly in phpmysql, and other texts I erased in the forum page. Now one of my tables has stopped incrementing. So no user can post any text to it. When I echo the $sql from mysql_query($sql), and try it manualy in phpmyadmin it gives out message that :" #1062 - Duplicate entry '127' for key 'PRIMARY'". I have tried deleting text with that key and I could insert one text after that. But on the next try it gives the same message. So I conclude that the auto increment key hung up on 127. Although when I check in the phpmyadmin in the operations it shows auto_increment 128. I am struggling all day long with this. Pleas help. Quote Link to comment https://forums.phpfreaks.com/topic/196164-mysql-database-table-stopped-auto-incrementing/ Share on other sites More sharing options...
fenway Posted March 23, 2010 Share Posted March 23, 2010 You didn't make the field big enough... it's a SMALLINT, right? Make it INT UNSIGNED. Quote Link to comment https://forums.phpfreaks.com/topic/196164-mysql-database-table-stopped-auto-incrementing/#findComment-1030310 Share on other sites More sharing options...
zoran Posted March 23, 2010 Author Share Posted March 23, 2010 No, I have found out , through all day's work that my database was corrupted because I deleted something from one table that other table than could not fetch its data. thanks anyway Quote Link to comment https://forums.phpfreaks.com/topic/196164-mysql-database-table-stopped-auto-incrementing/#findComment-1030447 Share on other sites More sharing options...
fenway Posted March 23, 2010 Share Posted March 23, 2010 I highly doubt that made the auto-increment "stop working", but if you think your problem is "solved", mark it as asuch. Quote Link to comment https://forums.phpfreaks.com/topic/196164-mysql-database-table-stopped-auto-incrementing/#findComment-1030552 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.