脚本宝典收集整理的这篇文章主要介绍了php – mysql – 在表2中删除特定行时在表1中插入行,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
MysqL said: #1363 - There is no NEW row in on DELETE trigger
MysqL> create table test (id int,val vArchar(20),date datetime); Query OK,0 rows affected (0.09 sec) MysqL> insert into test values (1,'aa',Now()),(2,'bb',(3,'cc',Now()); Query OK,3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 MysqL> create table test1 like test; Query OK,0 rows affected (0.06 sec) MysqL> delimITer // MysqL> create trigger test_del after delete on test -> for each row -> begin -> insert into test1 (id,val,date) values (old.id,old.val,old.date); -> end ; -> // Query OK,0 rows affected (0.12 sec) MysqL> delimiter ; MysqL> select * From test ; +------+------+---------------------+ | id | val | date | +------+------+---------------------+ | 1 | aa | 2014-09-15 15:08:13 | | 2 | bb | 2014-09-15 15:08:13 | | 3 | cc | 2014-09-15 15:08:13 | +------+------+---------------------+ 3 rows in set (0.01 sec) MysqL> select * from test1; Empty set (0.00 sec) MysqL> delete from test where id = 1 ; Query OK,1 row affected (0.03 sec) MysqL> select * from test1 ; +------+------+---------------------+ | id | val | date | +------+------+---------------------+ | 1 | aa | 2014-09-15 15:08:13 | +------+------+---------------------+ 1 row in set (0.00 sec)
以上是脚本宝典为你收集整理的php – mysql – 在表2中删除特定行时在表1中插入行全部内容,希望文章能够帮你解决php – mysql – 在表2中删除特定行时在表1中插入行所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。