je me permets de solliciter votre aide car je galère pour résoudre mon problème.
Il me faudrait récupérer les information de ma BDD en Mysql, pour l'afficher les résultats dans le tableau HTML.
Mais je me retrouve avec une seconde ligne créée, mais vide.
Auriez vous une idée ?
voici le code
merci
Arnaud
Code : Tout sélectionner
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<title>Demandes en cours</title>
</head>
<body>
<header><img src="img/footer.jpg" alt="Logo entreprise"/></header>
<?php
try
{
// On se connecte à MySQL
$bdd = new PDO('mysql:host=localhost;dbname=maintenance;charset=utf8', 'root', 'Password');
}
catch(Exception $e)
{
// En cas d'erreur, on affiche un message et on arrête tout
die('Erreur : '.$e->getMessage());
}
?>
<div id="section">
<p class="titre_principal">Demandes d'interventions en cours</p>
<div class="corps">
<table>
<tr>
<th style="width:5%">ID</th>
<th style="width:25%">Problèmes Signalés</th>
<th style="width:25%">Localisation</th>
<th style="width:35%">Description</th>
<th style="width:5%">Date</th>
<th style="width:20%">Demandeur</th>
<th style="width:10%">Etat</th>
</tr>
<?php
$reponse = $bdd->query('SELECT * FROM demandes');
while ($row = $reponse->fetch());
{
echo '<tr><th >'.$row['ID'].'</th><th>'.$row['Titre_Prob'].'</th><th>'.$row['Localisation'].'</th><th>'.$row['Desc_Prob'].'</th><th>'.$row['Date'].'</th><th>'.$row['Demandeur'].'</th><th>'.$row['Etat'].'</th><tr>';
}
?>
</table>
</div>
</div> <a href="test.html" title="Retour à l'accueil"><img src="img/accueil.png" alt="retour accueil"/></a>
</body>
</html>