「$taille」配列の結果がキー [0] ではなくキー [1] で始まる理由がわかりません。
そのため、4 ではなく 3 つの結果が表示されます (最初の結果が見えなくなります)...
<?php
$req = $bdd->prepare('SELECT size FROM tailles_produits WHERE id_produit = ?');
$req->execute(array($_GET['id']));
$donnees = $req->fetch();
$numb_taille = array();
$taille = array();
$i = 0;
while($donnees = $req->fetch())
{
$i++;
$taille[$i] = $donnees['size'];
$numb_taille['total'] = $i;
}
$total = $numb_taille['total'];
echo '<pre>';
print_r ($taille);
echo '</pre>';
$req->closeCursor();
?>
どちらが与える
ARRAY
(
[1] => S
[2] => M
[3] => L
)
それ以外の
ARRAY
(
[1] => XS
[2] => S
[3] => M
[4] => L
)
誰でもこの嘆願で私を助けることができますか?