problem in creating a trigger
Hi,
I have this code in creating a trigger:
Code:
create trigger trigger1_trigger on trigger1 for insert
BEGIN
insert into trigger2(t2name) values("myname");
END
I don't know the rules in creating a trigger, and this code won't work. What I want to achieve was that, if I inserted a new row to trigger1 table, the new row (the name column only) will be inserted automatically to trigger2 table. How do I do that using trigger?
LIST OF TABLES AND ITS ATTRIBUTES:
table : trigger1
attributes:
t1id int not null auto_increment primary key
t1name varchar(40)
t1age int
table : trigger2
attributes:
t2id int not null auto_increment primary key
t2name varchar(40)