im trying to make an trigger that updates a table when i modify another table... Here is my code:
CREATE TRIGGER updpartido AFTER UPDATE ON partidos
ON EACH ROW
BEGIN
SET @vgls = SELECT vgoles(NEW.eqvis)
SET @lgls = SELECT vgoles(NEW.eqloc)
UPDATE equipos SET gf=@vgls WHERE id=NEW.eqvis
UPDATE equipos SET gf=@lgls WHERE id=NEW.eqloc
END
What it must do is, when i update an match, it must automaticly run this trigger and update the goals.
But it gives me an error. What im doing wrong? Thanks and have a nice day...!