Re: mod primary key field - newbie question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sounds like you want to set the auto increment. To do that, use this query:
alter table `table_name` auto_increment 1;

That will reset it to one. Although I've never tried it, I assume you can give it another value.

Take care,
Floyd

On Jul 13, 2009, at 5:35 PM, cool@xxxxxxxxxxxxxxxx wrote:

newbie question ... I have a MySQL table where I want to update (renumber) the primary numeric key field.

- I successfully turned field off as a primary key index and UN auto incremented it
- then created new sequential numbers for it
- then turned back on primary key index and re added auto increment in


BUT when I make a new record it does NOT  start where new numbers stop

last is 51
next should be 52

but jumps to 157

Q: is there a way to reset the NEXT SERIAL ID NUMBER somewhere? how do I fix this?


--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists 09]





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux