Home What is the issue with this trigger (for the right syntax to use near '' )
 Please I did this trigger to update table rating after each insert when 2 columns (id_prof,id_etud) inserted are already in the table but it gives mi this error > #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 6  The trigger : CREATE TRIGGER Before_Insert_Rate BEFORE INSERT ON rating FOR EACH ROW BEGIN IF (EXISTS(SELECT * FROM rating WHERE id_prof=NEW.id_prof and id_etud = NEW.id_etud)) THEN UPDATE rating SET rate = NEW.rate WHERE id_prof = NEW.id_prof and id_etud = NEW.id_etud; ELSE INSERT INTO rating VALUES (NEW.idprof,New.rate,New.id_etud); END IF END DELIMITER ;