Error in IF statement in MySQL
You cannot execute such statements unless you use a stored proc:
You can run this below. It should work.

DROP procedure IF EXISTS `test2`;
DELIMITER $$
CREATE  PROCEDURE `test2`(p_employee_number int, p_date datetime)
Begin

if  NOT EXISTS (SELECT 1 
    FROM employee_attendance 
        WHERE employee_number =p_employee_number  AND attendance_date_time = p_date) THEN

    INSERT IGNORE INTO employee_attendance (employee_number, attendance_date_time)  VALUES (p_employee_number, p_date);

End if ;
END$$

DELIMITER ;