Jump to content

Archived

This topic is now archived and is closed to further replies.

otuatail

PHP MyAdmin

Recommended Posts

I am using PHP myAdmin and MySQL. Please can anyone tell me how to change the value of the next autoindex


Desmond.

Share this post


Link to post
Share on other sites
How do you mean change the next autoindex? It should increment one more by itself. Or do you want it to start auto increment from a certain number, like 100, so the next one will be 101, after that 102 etc?

Share this post


Link to post
Share on other sites
Correct I have deleted a lot of rows and would like to wind back the counter

Desmond.

Share this post


Link to post
Share on other sites
I wouldnt recommend you do this as this not how auto_increment works each auto generated number should be unquie, meaning you cannot have two rows with the same id or an id that has been previously been used, however if it was to fast forward the counter then yes.

However if you want to do this, then you'll want to run the following query through phpMyAdmin:
[code]ALTER TABLE tbl_name AUTO_INCREMENT = x;[/code]
Change tbl_name with the actuall table you want to change the counter and x with the number you want to the counter to start at.

Share this post


Link to post
Share on other sites
Thanks for that. I wouldn't have gone overboard and ftried to duplicate the ID.
Thanks that worked a treat.

Desmond.

Share this post


Link to post
Share on other sites
you can also go to "Operations" in phpMyAdmin

Share this post


Link to post
Share on other sites
cmgmyr, Interesting I've never looked at that option. It has a lot of features that'll be useful to me, especially correcting spelling errors with database/table names. I'll grace you :)

Share this post


Link to post
Share on other sites
Thank you for that! I like phpMyAdmin it is a great tool to have and use. It saves soooo much time!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.