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
|
<?php
$connect = mysql_connect ("localhost","root","")
or die ("connexion impossible");
mysql_select_db("dvd")
or die ("Base de données introuvable");
$query = "select matricule, nom, prenom from adherent";
$result=mysql_query($query)
or die("La requete a échoué");
?>
<select name ="adherent">
<?php
for ($i=0 ; $i < mysql_num_rows($result); $i++)
{
$line=mysql_fetch_array($result);
?>
<option value= "<?php echo($line["numadh"]); ?>">
<?php echo("{$line["matricule"]} - {$line["nom"]} {$line["prenom"]}");?>
</option>
<?php
}
?>
</select>
<?php
$num = $line["matricule"];
echo $num;
$queryretours = "select e.numdvd, titredvd, codegenre, realisateur, dateemprunt
from dvd d, emprunter e, adherent a
where d.numdvd=e.numdvd
and e.matricule=a.matricule
and matricule = $num";
$resultretours = mysql_query($queryretours);
$lineretours = mysql_fetch_array($resultretours);
?> |
Partager