<?php
$sql = "SELECT * FROM toto ORDER BY produit DESC";
$pdostat = $bdd->prepare($sql);
$pdostat->execute();
$produit = 0;
while ($resultat = $pdostat->fetch())
{
$produit++;
$id = $resultat['id'];
$produit = $resultat['produit'];
?>
<table><font size="5"><td>
<?php echo'<a href="/achat_toto.php?id=' . intval($id['id']) . '"><img src="' . htmlentities($produit['produit']) . '"></a>';?>
</table>
<?php
}
?>
le message d'erreur:Cannot access offset of type string ............
Je n'arrive pas à trouver l'écriture correcte pour avoir un lien sur chaque produit listé.