WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

MySQL Trigger

Snatcher

New member

0

0%

Status

Offline

Posts

32

Likes

0

Rep

0

Bits

170

3

Months of Service

0%
Hello, I am encountering an error while trying to create a command with Trigger in MySQL. What I am trying to do exactly is to create a trigger to calculate the average of the values entered in other cells after inserting a value in a specific cell that remains empty. I tried the following: "CREATE TRIGGER calculate BEFORE INSERT ON FOR EACH ROW SET attack=AVG(finishing+dribbling+ballcontrol+firsttouch+heading+positioning+reactions);" and also, instead of the avg command directly, I tried "CREATE TRIGGER calculateattack BEFORE INSERT ON FOR EACH ROW SET attack=(finishing+dribbling+ballcontrol+firsttouch+heading+positioning+reactions)/7;" but I couldn't get the desired result. I would be very happy if you could help. Thank you in advance.
 

249

6,622

6,642

Top