摘要:
(一)利用外键实现级联删除1、先建立测试数据库CREATE TABLE `roottb` ( `id` INT(11) UNSIGNED AUTO_INCREMENT NOT NULL, `data` VARCHAR(100) NOT NULL DEFAULT '', PRIMARY KEY (`id`)) TYPE=InnoDB;CREATE TABLE `subtb` ( `id` INT(11) UNSIGNED AUTO_INCREMENT NOT NULL, `rootid` INT(11) UNSIGNED NOT NULL DEFAULT '0', 阅读全文