Bonsoir tout le monde!!

svp aidez moi

j'ai trois tables:

article(id_article,num,prix_achat,date_achat,duree_garantie,id_etr_agence,id_etr_marque)
marque(id_marque,lib_marque)
agence(id_agence,lib_agence)

quand j'éxécute mon code ,j'ai ce message :
Erreur : SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`gestion_articles`.`article`, CONSTRAINT `FK_article_id_marque` FOREIGN KEY (`id_etr_marque`) REFERENCES `marque` (`id_marque`))

voilà mon code:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
try
               {
	           $pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
	           $bdd = new PDO('mysql:host=localhost;dbname=gestion_articles', 'root', '', $pdo_options);
 
 
					$req = $bdd->prepare('INSERT INTO agence(lib_agence) VALUES(:login,:lib_agence)');
 
 
                   $req->execute(array(
 
				   'lib_agence' => $_POST['lib_agence'],
 
	                ));
					$req = $bdd->prepare('INSERT INTO marque(lib_marque) VALUES(:login,:lib_marque)');
 
 
                   $req->execute(array(
 
				   'lib_marque' => $_POST['lib_marque'],
 
	                ));
 
 
 
 
 
$req = $bdd->prepare('INSERT INTO article(num,prix_achat,date_achat,duree_garantie)         VALUES(:login,:num,:prix_achat,:date_achat,:duree_garantie)');
 
 
 
 
		$req->execute(array(
 
				   'num' => $_POST['num'],
 
				   'prix_achat' => $_POST['prix_achat'],
				   'date_achat' => $_POST['date_achat'],
				   'duree_garantie' => $_POST['duree_garantie'],
 
 
				   ));
 
 
 
				header("Location:acquisition.php ");
 
 
                }
                catch (Exception $e)
                {
                die('Erreur : ' . $e->getMessage());
                }


svp aidez moi ,je ne sais pas quoi faire

Merci.