proble with the trigger in phpmyadmin

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
maheshn
Forum Newbie
Posts: 2
Joined: Thu Nov 16, 2017 3:10 am

proble with the trigger in phpmyadmin

Post by maheshn »

IF NEW.avg > 15
THEN
SET NEW.grade='p'
ELSE
SET NEW.grade='F'
END IF ;

I am applying this trigger before insert in xampp .but i am getting an syntax error #1064 you have an error in sql syntax near ELSE SET NEW.grade='F'
END IF ;

please help me to resolve this error
benanamen
Forum Newbie
Posts: 18
Joined: Sun Nov 15, 2015 11:57 am

Re: proble with the trigger in phpmyadmin

Post by benanamen »

Looks like you're missing semi-colons.
maheshn
Forum Newbie
Posts: 2
Joined: Thu Nov 16, 2017 3:10 am

Re: problem with the trigger in phpmyadmin

Post by maheshn »

Thank u very much .. can u plz tell me where am I missing semicolon
Post Reply