salut je veut faire la modification des champs d'une table composant qui contient des clés étrangère d'autre table le problème que la modification ne fait pas j'arrive pas a connaitre les erreurs
1er page modif_composant
la tabe composant (cle_composant,capacite,num_par_type,#cle_categorie,#cle_equip)

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
<?php 
session_start();
include('connexion base.php');
?>
<html>
<head>
<title>Modification composant</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
 
<body>
<table align="center" border="double" >
<tr><td>capacité</td><td>numéro par type </td><td>clé equipement</td><td>clé categorie</td><td>type</td></tr>
<?php 
$res=mysql_query("select * from composant");
while($rep=mysql_fetch_array($res))
{
	$id=$rep['cle_composant'];
	$capacite=$rep['capacite'];
	$num_par_type=$rep['num_par_type'];
	$cle_equip=$rep['cle_equip'];
	$cle_categorie=$rep['cle_categorie'];
 
?>
<tr>
<td><?php echo $capacite; ?></td>
<td><?php echo $num_par_type; ?></td>
<td><?php echo $cle_equip; ?></td>
<td><?php echo $cle_categorie; ?>
</td><td><a href="valid composant.php?id=<?php echo $id;?>">Modifier</a></td>
</tr>
<?php } ?>
</table>
</body>
</html>
2 eme page valid composant
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
<?php 
session_start();
//if(!isset($_SESSION['id_user'])) header('location:acceuil.php');
 
include('connexion base.php');
if(isset($_POST['capacite']))
{
	$id=$_POST['id'];
	$capacite=$_POST['capacite'];
	$num_par_type=$_POST['num_par_type'];
	$cle_equip=$_POST['cle_equip'];
	$cle_categorie=$_POST['cle_categorie'];
	mysql_query("update composant set capacite='$capacite',num_par_type='$num_par_type',cle_equip='$cle_equip',cle_categorie='$cle_categorie'  where cle_composont='$id' ");
	header("location:modif_composant.php");
}
 
?>
<html>
<head>
<title>valid_modif_composant</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
 
<body>
<?php 
if(isset($_GET['id']))
{
	$id=$_GET['id'];
	$res=mysql_query("select * from composant where cle_composant='$id'");
	$rep=mysql_fetch_array($res);
	$id=$rep['cle_composant'];
	$capacite=$rep['capacite'];
	$num_par_type=$rep['num_par_type'];
	$cle_equip=$rep['cle_equip'];
	$cle_categorie=$rep['cle_categorie'];
 
	?>
	<center>
		<form action="valid composant.php" method="post">
			capacité:    <input name="capacite" type="text" value="<?php echo $capacite; ?>" /><br /><br />
				numero par type : <input name="num_par_type" type="text" value="<?php echo $num_par_type; ?>" /><br /><br />
				ref clé equipement:  <input name="cle_equip"   type="text" value="<?php echo $cle_equip; ?>" /><br /><br />
				ref clé categorie: <input name="cle_categorie"   type="text" value="<?php echo $cle_categorie; ?>" /><br /><br />
				<input type="hidden" name="id" value="<?php echo $id; ?>" />
				<input type="submit" value="modifier" />
		</form>
	</center>
<?php 	
}
?>