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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Site</title>
<header>
<?php include ("entete.php"); ?>
</header>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<nav>
<?php include("menus.php"); ?>
</nav>
<p>
Sélectionnez le nom de la personne dont vous souhaitez modifier les données.
</p>
<center>
<form>
<input type="text" id="nom" name="nom" />
<input type="submit" value="ok" /></center>
</form>
<?php
try
{
// On se connecte à MySQL
$bdd = new PDO('mysql:host=localhost;dbname=fonctions;charset=utf8', 'root', '');
}
catch(Exception $e)
{
// En cas d'erreur, on affiche un message et on arrête tout
die('Erreur : '.$e->getMessage());
}
?>
<center>
<table border=1 width=50%>
<tr>
<th>
Nom
</th>
<th>
Prénom
</th> <th>
E-mail
</th>
</tr>
<tr>
<td width=12%>
<?php
$reponse = $bdd->prepare('SELECT * FROM abonnes WHERE
nom=:nom');
$reponse->execute();
?>
</td>
<td width=3% align="center">
<?php $reponse = $bdd->query('SELECT nom FROM abonnes WHERE
nom=nom');
while ($donnees = $reponse->fetch())
{
echo $donnees['nom'];
}
?>
</td>
<td width=15%>
<?php $donnees = $bdd->query('SELECT nom FROM abonnes WHERE
nom=:nom)');?>
<?php
while ($donnees = $reponse->fetch())
{
echo $donnees['nom'];
}
?>
</td>
</tr>
</center>
</table>
</center>
<?php
$reponse->closeCursor();
?>
</body>
<?php include("pied_de_page.php"); ?>
</html> |
Partager