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
|
<form method="post" action="traitC.php">
<table>
<thead>
<tr>
<th>Numéro </th>
<th>Nom</th>
<th>Prénom</th>
<th>Trigramme</th>
<th>Email</th>
</tr>
</thead>
<?php
try
{ // On se connecte Ã* MySQL
$bdd = new PDO('mysql:host=localhost;dbname=ao', 'root', '');
}
catch(Exception $e)
{ // En cas d'erreur, on affiche un message et on arrête tout
die('Erreur : '.$e->getMessage());
}
// On récupère tout le contenu de la table consultation
$reponse = $bdd->query('SELECT * FROM consultants')or die(print_r($bdd->errorInfo()));
// On affiche chaque entrée une à* une
while ($donnees = $reponse->fetch())
{
?>
<form method="post" action="ModifConsultant.php">
<tr>
<td> <?php echo '<input type="hidden" name="id" value="' . $donnees['id'] . '" />' . $donnees['id'];?>
<input type="submit" value="Modifier" name="modifier"/>
<input type="submit" value="Supprimer" name="supprimer"/>
</td>
</form>
<td> <?php echo $donnees['Nom']; ?></td>
<td> <?php echo $donnees['Prenom']; ?> </td>
<td> <?php echo $donnees['Trigramme']; ?> </td>
<td> <?php echo $donnees['Email']; ?></td>
</tr>
<?php
}
$reponse->closeCursor(); // Termine le traitement de la requète
?>
</table>
</form> |