I did a while loop to display data from my table cards. The problem is that it does not display the first row of the table
$reponse = $bdd->query('SELECT * FROM cartes');
$donnees = $reponse->fetch();
while ($donnees = $reponse->fetch()) {
?>
<p>
<strong>Carte: </strong> <br /><br />
<u>ID:</u> <?php echo $donnees['ID']; ?><br />
<u>Propriétaire:</u> <?php echo $donnees['nom']; ?><br />
</p>
<?php
}
$reponse->closeCursor();
?>
My table:
CREATE TABLE IF NOT EXISTS `cartes` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`nom` varchar(255) NOT NULL,
PRIMARY KEY (ID)
) ENGINE=INNODB DEFAULT CHARSET=latin1 AUTO_INCREMENT=51;
Thanks