MySQL Syntax error when trying to create database trigger When Trying to create the below trigger, I am receiving a syntax error. It looks good to me and I'm having a terrible time trying to figure it out. 

  DELIMITER $$
    CREATE TRIGGER trg_pic_hours
    AFTER INSERT ON CREW
    FOR EACH ROW
    BEGIN
    IF (NEW.CREW_JOB = 'Pilot') THEN
    UPDATE PILOT
    SET PIL_PIC_HRS = TEMP_PIL.PIL_PIC_HRS + CHARTER.CHAR_HOURS_FLOWN
    WHERE CHARTER.CHAR_TRIP = NEW.CHAR_TRIP
    AND PILOT.EMP_NUM = NEW.EMP_NUM;
    ENDIF;
    END$$
    DELIMITER;

ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; END' at line 10
ENDIF;
END$$
DELIMITER;


-->

END IF;
END $$
DELIMITER ;


END IF is 2 words.
Have a space before the delimiter.