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
| <script>
function pouressayer(){
valeur = document.getElementById("essais").value;
alert (valeur);
}
</script>
<body>
<?php
echo'<table>
<tr >
<th></th>
<th>nom</th>
<th>prenom</th>
<th>age</th>
<th>sexe</th>
</tr>';
$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
$bdd = new PDO('mysql:host=localhost;dbname=utilisateur', 'root', '', $pdo_options);
$reponse = $bdd->query("SELECT distinct * FROM utilisateur ORDER BY nom,prenom,age,sexe");
while ($donnees = $reponse->fetch()) {
echo
'<tr onclick="pouressayer()">
<td><input type="hidden" id="essais" value="' . $donnees["id"] . '">Info</td>
<td id="fichenom">' . $donnees['nom'] . '</td>
<td id="ficheprenom">' . $donnees['prenom'] . '</td>
<td id="ficheage">' . $donnees['age'] . '</td>
<td id="fichesexe">' . $donnees['sexe'] . '</td>
</tr>' . "\n";
}
$reponse->closeCursor();
echo'</table>';
?> |
Partager