"Sviss Cobazor" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Now I want to delete user with ID = 2. > Now I create a new user, he will get ID = 4. > > How can i reuse the ID 2 for creation of new users?
I am not familiar with MySQL specifically but in my database experience you cannot reuse an auto-increment number. One approach I have taken in the past is to have my own table with a number field(s) and manually increment it, then use that in the other tables. I suppose you could scan for unused numbers but this seems quite time consuming. You just have to be aware of locking other write requests so no two try to share a number. > Another thing: > If ID is INT(3), what will happen when I insert user no. 1000? Most databases I've seen make an autoincrement field a longint. - Steve Yates - Gone crazy, be back later. Please leave a message. <Beep!> / Taglines by Taglinator - www.srtware.com / -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php