bonjour

voila j essaye de faire un insert dans ma table fonction. se que je comprend pas cest pourquoi j ai une erreur est pourquoi il me parle de idemploye est idfonction vue qu il sont en auto increment.


insert into fonction
(type_fonction)
values ('cadre'),
('ingenieur');
est j ai une erreur

Cannot add or update a child row: a foreign key constraint fails (`infodis/fonction`, CONSTRAINT `fk_employe_fonction` FOREIGN KEY (`idfonction`) REFERENCES `employe` (`idemploye`))
voici le descriptif des tables
FONCTION
create table groupe (
idfonction int unsigned primary key auto_increment,
type_fonction varchar(30) not null
) engine=innodb;
EMPLOYE
create table employe (
idemploye int unsigned primary key auto_increment,
nom varchar(20) not null,
identreprise int unsigned not null,
key (identreprise),
idgroupe int unsigned not null,
key (idgroupe),
idcontrat int unsigned not null,
key (idcontrat),
idfonction int unsigned not null,
key (idfonction),
constraint fk_entreprise_employe foreign key (identreprise) references entreprise (identreprise),
constraint fk_groupe_employe foreign key (idgroupe) references groupe (idgroupe),
constraint fk_contrat_employe foreign key (idcontrat) references contrat (idcontrat),
constraint fk_fonction_employe foreign key (idfonction) references fonction (idfonction)
) engine=innodb;
encore merci a vous tous pour votre aide 
