【发布时间】:2011-05-19 07:22:54
【问题描述】:
我有一个数据库,tvguide,这些是值:
id bigint 255 UNSIGNED AUTO_INCREMENT
programme varchar 255
default value (which is from another table
with list of programs, the only linked field that
is shared with 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 that airs 1.59pm
would be shown as 2.00pm, or 6.08pm as 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 to user, but that's
another thing to work on).
我想在我的数据库中插入一个触发器,以便在删除记录时,ID 自动增量自动重新设置?
关于如何做到这一点的任何想法?到目前为止,我已经手动完成了它,但我正在研究删除记录时我可以用 phpMyadmin 做什么。
顺便说一句,我为备份目的制作了该表的副本。
谢谢
【问题讨论】:
-
你不必重新设置自动增量,让它增长...
标签: mysql database triggers phpmyadmin record