mysql - Trigger for re-setting auto-increment of tables in phpMyadmin -


i have database, tvguide , these values:

id bigint 255 unsigned auto_increment programme varchar 255  default value (which table list of programs, linked field shared other table):<b><a href="gossipgirl.php">gossip girl</a></b> channel varchar 255 airdate datetime - actual airtime displayair datetime (rounded-up datetime, e.g. programme airs 1.59pm  shown 2.00pm, or 6.08pm 6.10pm) expiration datetime - when program finishes episode varchar 255 null - has null option if episode unknown series varchar 255 epno varchar 255 - episode number setreminder varchar255 (shows "set reminder", sends email user, that's  thing work on). 

i want insert trigger database if record deleted, id auto-increment re-sets automatically?

any ideas on how accomplish this? i've done manually far looking @ seeing can phpmyadmin when delete record.

btw made copy of table backup purposes.

thanks

i agree whitstone86's comment can "let grow".

having said that, change auto_increment @ time, can run alter table.

some pseudo code...

select max(id)+1 max_id_plus_one my_table;  alter table my_table auto_increment = $max_id_plus_one; 

for production, race conditions might issue. however, if it's puttering around in phpmyadmin, should suffice.


Comments

Popular posts from this blog

400 Bad Request on Apache/PHP AddHandler wrapper -

Add email recipient to all new Trac tickets -

php - Change action and image src url's with jQuery -