DJRobThaMan
11-12-2009, 04:22 PM
Hi,
I've tried to add a trigger using the following inside a .sql script
delimiter //
create trigger editSniffer
after insert on shelfData
for each row
begin
declare publishedint integer;
select published into publishedint from versionData where pvid = new.pvid;
if publishedint >= 1 then
insert into edits(editid, pvid, category, original, `new`) values(null, new.pvid, 'shelf', new.sid);
end if;
end//
Funnily enough, I can execute the same code (minus the delimiter statement) if I use phpMyAdmin and set the delimiter using their text box below the sql input area.
Does anyone know how to add this trigger (or any multi statement of that type) via a .sql script?
I've tried to add a trigger using the following inside a .sql script
delimiter //
create trigger editSniffer
after insert on shelfData
for each row
begin
declare publishedint integer;
select published into publishedint from versionData where pvid = new.pvid;
if publishedint >= 1 then
insert into edits(editid, pvid, category, original, `new`) values(null, new.pvid, 'shelf', new.sid);
end if;
end//
Funnily enough, I can execute the same code (minus the delimiter statement) if I use phpMyAdmin and set the delimiter using their text box below the sql input area.
Does anyone know how to add this trigger (or any multi statement of that type) via a .sql script?