Jump to content


Photo

PHP MyAdmin


  • Please log in to reply
7 replies to this topic

#1 otuatail

otuatail
  • Members
  • PipPipPip
  • Advanced Member
  • 960 posts

Posted 20 July 2006 - 07:31 PM

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


Desmond.


#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 20 July 2006 - 07:44 PM

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?

#3 otuatail

otuatail
  • Members
  • PipPipPip
  • Advanced Member
  • 960 posts

Posted 20 July 2006 - 07:49 PM

Correct I have deleted a lot of rows and would like to wind back the counter

Desmond.


#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 20 July 2006 - 07:58 PM

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:
ALTER TABLE tbl_name AUTO_INCREMENT = x;
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.

#5 otuatail

otuatail
  • Members
  • PipPipPip
  • Advanced Member
  • 960 posts

Posted 20 July 2006 - 08:02 PM

Thanks for that. I wouldn't have gone overboard and ftried to duplicate the ID.
Thanks that worked a treat.

Desmond.


#6 cmgmyr

cmgmyr
  • Members
  • PipPipPip
  • Advanced Member
  • 1,278 posts
  • LocationUSA

Posted 20 July 2006 - 08:02 PM

you can also go to "Operations" in phpMyAdmin

#7 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 20 July 2006 - 08:07 PM

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 :)

#8 cmgmyr

cmgmyr
  • Members
  • PipPipPip
  • Advanced Member
  • 1,278 posts
  • LocationUSA

Posted 20 July 2006 - 08:11 PM

Thank you for that! I like phpMyAdmin it is a great tool to have and use. It saves soooo much time!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users