Xtremer360 Posted April 1, 2010 Share Posted April 1, 2010 I use phpmyadmin with my mysql database on my server and would like to know how do I reset the auto increment from the last increment number because I had to delete a hole bunch of rows and instead of having 1,2,3,18,19. I could have 1,2,3,4,5 for the next inserted rows and no I"m not manually inserted data its all with queries from a script. Link to comment https://forums.phpfreaks.com/topic/197296-resetting-auto-increment/ Share on other sites More sharing options...
GetPutDelete Posted April 1, 2010 Share Posted April 1, 2010 Click "Empty" and it will clear the table and also reset the increment. Link to comment https://forums.phpfreaks.com/topic/197296-resetting-auto-increment/#findComment-1035547 Share on other sites More sharing options...
Xtremer360 Posted April 1, 2010 Author Share Posted April 1, 2010 I don't want to delete the data in it. I just have manually deleted some rows and when I have my php script insert rows I want it to continue on from the last inserted row. Link to comment https://forums.phpfreaks.com/topic/197296-resetting-auto-increment/#findComment-1035549 Share on other sites More sharing options...
GetPutDelete Posted April 1, 2010 Share Posted April 1, 2010 As far as I know that's not possible with phpMA alone. Now if you were writing a script to assign AI values then that would be different... Sorry dude, hope someone else has heard of a way. Link to comment https://forums.phpfreaks.com/topic/197296-resetting-auto-increment/#findComment-1035551 Share on other sites More sharing options...
Rustywolf Posted April 1, 2010 Share Posted April 1, 2010 i think ALTER table AUTO_INCREMENT = 1 Link to comment https://forums.phpfreaks.com/topic/197296-resetting-auto-increment/#findComment-1035552 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.