php-db | 2001051
Date: 05/10/01
- Next message: Paul Burney: "Re: [PHP-DB] Autoincrement Question"
- Previous message: Angie Tollerson: "Re: [PHP-DB] Autoincrement Question"
- In reply to: Angie Tollerson: "Re: [PHP-DB] Autoincrement Question"
- Next in thread: Paul Burney: "Re: [PHP-DB] Autoincrement Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[quotes restored to bottom-posting order, for clarity]
> > > > If I have a database that has three records and I delete the entire
> > > > third record, when another record is then added will the auto increment
> > > > number be 3 or 4? Thanks.
> > > I will be 3 Jeff :)
> > Only if the auto increment values started at zero. Otherwise, the number
> > will be 4.
> That is true if you delete a row in between other records..if you delete 2
> the fourth record added would be 4, not 2. BUT..in the default installation
> of mysql, if you delete the last record the auto increment will fill it's
> place..trust me, I just tried it :)
What version of MySQL and table type are you getting that on? I just tried
it with a MyISAM table in 3.23.33 (insert, immediate delete, immediate
insert), and the pk incremented as expected. No re-use of values.
-- CC-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Paul Burney: "Re: [PHP-DB] Autoincrement Question"
- Previous message: Angie Tollerson: "Re: [PHP-DB] Autoincrement Question"
- In reply to: Angie Tollerson: "Re: [PHP-DB] Autoincrement Question"
- Next in thread: Paul Burney: "Re: [PHP-DB] Autoincrement Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

