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
| <?php
define("Serveur_SGBD", "localhost");
define("Login_BDD", "root");
define("Mot_de_passe", "");
?>
<html>
<body>
<form method='POST' action='window.php'>
<table border="1">
<tr>
<td width=''>Mot-clés</td>
<td width=''>Choix</td>
</tr>
<?php
$id_SGBD=mysql_connect(Serveur_SGBD, Login_BDD,Mot_de_passe)or die ("Erreur à la connexion");
mysql_select_db("lyric") or die ("Erreur sélection BDD");
$query="SELECT mot, mot_id FROM keyword" ;
$result = mysql_query( $query )or exit ('Erreur SQL !'.$query.'<br>'.mysql_error());
while($data = mysql_fetch_array($result))
{
echo"<tr><td>".$data['mot']."</td>";
echo"<td><input type='checkbox' name='choix' value='".$data['mot_id']."'></td>";
echo"</tr>";
}
mysql_close();
?>
<br><input type='submit' name='choix' value='Choisir'>
</table>
</form>
</body>
</html> |
Partager