php - Using select statement inside of trigger -
so have learned somhing abou triggers in mysql..while using selct statement within trigger throws me error ..so after research have seen using select statement , inserting variable can done in trigger..so code have used is
create trigger ins_sum after update on foo each row declare int; select foo some; update foo set = 3 b = 1;
but throws me error schema creation failed: have error in sql syntax; check manual corresponds mysql server version right syntax utilize near 'declare int'
why ??..any help apreciated..thanx
i presume update foo not part of trigger wouldn't work within trigger on update foo.
delimiter // create trigger ins_sum after update on foo each row begin declare int; select new.a foo some; end // delimiter ;
php mysql
No comments:
Post a Comment