On Sunday 29 December 2002 12:26, Adam Więckowski wrote:

> I had a problem few days ago. I'm doing my questbook, and I were thinking
> what would hapen if I delete some row. Now I know, nothing. I had one
> column ID (auto_increment) in my table. I wanted it to be one by one even
> after deleting, so I changed it by myself. But then (after deleting the
> last ID was 17, and before 32), next ID was 33, not 18. Is there any
> function, which can change it?

Nope. It's expected behaviour for MyISAM and InnoDB tables.

>If not, mayby you'll try to do something
> like that. It's right, I can do it by myself not using auto_increment, and
> giving the ID number MAX(ID)+1, but if there is such function it would be
> realy fine. 

Sure, you can do it, but you should lock table, retrieve max id value, insert 
max+1 value, unlock table.






-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to