ex : article ->pantalon alpha |_ taille pantalon ->36 | ->38 | ->40 | tb_taille ->42 | ->44 | article ->pantalon omega |_ taille pantalon ->36 | ->38 | ->40 | tb_taille ->42 | ->44 |
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question$result = mysql_query("SELECT * FROM articles WHERE id='$id'"); if(!$result) exit; $article = mysql_fetch_array($result); echo 'nom: ' . $article[0] . ' '; echo '<select name="taille">'; $tailles = explode(',', $article[1]); for($i = 0; $i < count($tailles); $i++) echo '<option value="' . $tailles[$i] . '">' . $tailles[$i] . '</option>'; echo '</select>';
WHERE ref= '$ref'");
function afficher_article($article) { if (is_array($article)) { //descriptif echo ' nom: '; echo $article['nom']; echo ' Prix: '; echo $article['prix']; //liste deroulante $result = mysql_query("SELECT * FROM articles WHERE ref='$ref'"); if(!$result) exit; $article = mysql_fetch_array($result); echo 'choisissez une taille: ' . $article[0] . ' '; echo '<select name="taille">'; $tailles = explode(',', $article[1]); for($i = 0; $i < count($tailles); $i++) echo '<option value="' . $tailles[$i] . '">' . $tailles[$i] . '</option>'; echo '</select>'; } }