Un petit problème m'agace depuis un moment.
Je voudrais afficher les résultats d'une requête dans un tableau.
Le problème est que les titre de mon tableau se répète à chaque ligne. Voici mon code :
$reponse = $bdd->prepare("SELECT .......FROM..............WHERE nom=?");
$reponse->execute(array($_GET['nom'],));
while ($donnees = $reponse->fetch())
{
?>
<table>
<tr>
<th>titre1</th>
<th>titre2</th>
<th>titre3</th>
</tr>
<tr>
<td>......</td>
<td>......</td>
<td>......</td>
</tr>
</table>
<?php
}
$reponse->closeCursor();
?>
Et j'obtiens :
titre1 titre2 titre3
..... ...... ......
titre1 titre2 titre3
...... ...... .......
J'aimerais afficher :
titre1 titre2 titre3
...... ...... ......
...... ...... ......
Comment faire pour que les titres du tableau ne s'affiche qu'une seule fois?
Merci de votre aide