Commit dad84ea3 authored by Gaetan Carabetta's avatar Gaetan Carabetta

affichage client

parent 553ef95c
<html>
<head>
<title>Clinique Vétérinaire</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1>Information des clients</h1>
<table border="1">
<tr>
<th>idClient</th>
<th>Nom</th>
<th>Prenom</th>
<th>Date de naissance</th>
<th>Adresse</th>
<th>Numéro</th>
</tr>
<?php
// Connexion à la base de données
include("connexion.php");
try{
$vConn = new PDO("pgsql:host=$vHost;port=$vPort;dbname=$vData", $vUser, $vPass);
} catch(PDOException $e){
echo "Erreur de connexion '$e'";
}
// Affichage du tableau de données
$vSql = "select * from client";
try{
$vSt = $vConn->prepare($vSql);
$vSt->execute();
while ($vResult = $vSt->fetch(PDO::FETCH_BOTH)) {
echo '<tr>';
echo "<td>$vResult[0]</td>";
echo "<td>$vResult[1]</td>";
echo "<td>$vResult[2]</td>";
echo "<td>$vResult[3]</td>";
echo "<td>$vResult[4]</td>";
echo "<td>$vResult[5]</td>";
echo '</tr>';
}
} catch(PDOException $e){
echo "Erreur de requete '$e'";
}
?>
</table>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment