Problème de listes déroulantes liées avec requêtes sql
Bonjour,
Je suis débutant et malgré Mon pb est le suivant
je possède les tables suivante
ordinateur (matricule_ord, ..... )
logiciel(nom_logiciel....
instal_log (matricule_ordi,nom_logiciel.....) //table ou se trouve les logiciels installé sur tel ordinateurs
je souhaite dans ma page PHP que l'utilisateur selectionne un logiciel et indique sur quel pc il voudrait l'installer via deux listes déroulantes
mais ce que je souhaite également c'est que lorsque l' on selectionne un nom de logiciel, je ne trouve dans ma liste déroulante d'ordinateurs que les ordinateurs sur lequel le logiciel n'est pas encore installé
je n'arrive pas malgré mes recherches à rafraichir ma liste ordinateur selon le logicel utilisé
voicis le code de ma page ou je selectionne le logiciel et l'ordinateur. Si vous pouviez m'aider à trouver le code manquant. Je n'ai pas compris les tutoriaux que j'avais trouvé
Merci d'avance
Code:
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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>Gestion du parc informatique</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" media="screen" type="text/css" title="format" href="styles/format.css" />
</head>
<body class="page">
<h1 align="center"><img src="images/logo.gif" width="200" height="70"></h1>
<h2 align="center"><i><b> Gestion du parc informatique </i></b></h2>
<hr>
<br>
<A HREF="index.htm"> Acceuil </A> >
<br>
<br>
<h3 align="center"><b><u>Installer une licence sur un PC</b></u></h3>
<table>
<form name="ajout" enctype="multipart/form-data" action="ajoutaffect.php" method="post">
<col valing=left width=300>
<!-- Selection dans la table des logiciel avec nombre d'achat de licences superieur à 0 !-->
<td><td><H3 ALIGN="left">choix du logiciel </b></td>
<td>
<SELECT name="nom_log" size="1">
<?mysql_connect("localhost", "root", "");
mysql_select_db("keinfor");
$SQL = "SELECT nom_log
FROM logiciel
WHERE nbr_valid_lic > '0' ";
$res = mysql_query($SQL);
while($val=mysql_fetch_array($res)) {
echo '<option>'.$val['nom_lic'].' '.$val['key_lic'].'</option>';
}
?>
</SELECT>
</td>
<tr>
<!-- Selection dans la table ordinateur des ordinateurs !-->
<td><td><H3 ALIGN="left">Choisissez le PC </b></td>
<td>
<SELECT name="mat_ord" size="1">
<?mysql_connect("localhost", "root", "");
mysql_select_db("keinfor");
$SQL = "SELECT mat_ord
FROM ordinateur
WHERE etat_ord NOT LIKE 'HS'
";
$res = mysql_query($SQL);
while($val=mysql_fetch_array($res)) {
echo '<option>'.$val['mat_ord'].'</option>';
}
?>
</SELECT>
</td>
</TABLE>
<br>
<h3 align="center">
<input type="submit" value="Valider">
<INPUT type="reset"></h3>
</body>
</html> |