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
|
<html>
<head>
</head>
<body>
<form method="post" action="dataforme.php">
<select name="consoles">
<option value="ps2">ps2</option>
<option value="Xbox">xbox</option>
<option value="pc">pc</option>
<option value="Megadrive">Megadrive</option>
<optgroup label="nintendo" >
<option value="NES">NES</option>
<option value="GameCube">GameCube</option></optgroup>
</select>
<input type="submit">
</form>
<br>
<?php
if (isset($_POST['consoles']))
{
mysql_connect('localhost', 'root', 'blackballwin');
mysql_select_db('pageperso');
$marque_console = $_POST['consoles'];
$donnees = mysql_query("select * from jeux_videos where console='.$marque_console.'") or
die(mysql_error());
while ($resultat = mysql_fetch_array($donnees))
{
?>
<tr>
<td><?php echo $resultat['nom']; ?></td>
<td><?php echo $resultat['possesseur']; ?></td>
<td><?php echo $resultat['console']; ?></td>
<td><?php echo $resultat['prix']; ?></td>
<td><?php echo $resultat['nbre_joueurs_max']; ?></td>
<td><?php echo $resultat['commentaires']; ?></td>
</tr>
<?php
}
mysql_close();
}
else
{
echo "selectionner une marque de consoles ";
}
?>
</body>
</html> |