php-db | 2001051
Date: 05/10/01
- Next message: CC Zona: "Re: [PHP-DB] Autoincrement Question"
- Previous message: CC Zona: "Re: [PHP-DB] Autoincrement Question"
- Maybe in reply to: Jeff Oien: "[PHP-DB] Autoincrement Question"
- Next in thread: CC Zona: "Re: [PHP-DB] Autoincrement Question"
- Reply: CC Zona: "Re: [PHP-DB] Autoincrement Question"
- Reply: Paul Burney: "Re: [PHP-DB] Autoincrement Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 :)
>>> CC Zona <cczona <email protected>> 05/10/01 02:07PM >>>
In article <safa95c4.095 <email protected>>,
Tollerson <email protected> ("Angie Tollerson") wrote:
> I will be 3 Jeff :)
>
>
> >>> "Jeff Oien" <jeff <email protected>> 05/10/01 01:13PM >>>
> 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.
Only if the auto_increment values started at zero. Otherwise, the number
will be 4.
In answer to the question the poster seems to really be asking:
auto_increment doesn't go back and re-use values from deleted rows. What
if you have data in other tables where a foreign key ties (undeleted) data
in that table to the deleted row in the first table? If the value was
re-used, then the data in the second table would suddenly be establishing a
bogus relationship to the new data in the first.
-- 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>
-- 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: CC Zona: "Re: [PHP-DB] Autoincrement Question"
- Previous message: CC Zona: "Re: [PHP-DB] Autoincrement Question"
- Maybe in reply to: Jeff Oien: "[PHP-DB] Autoincrement Question"
- Next in thread: CC Zona: "Re: [PHP-DB] Autoincrement Question"
- Reply: CC Zona: "Re: [PHP-DB] Autoincrement Question"
- Reply: Paul Burney: "Re: [PHP-DB] Autoincrement Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

