mardi 14 juin 2016

How to detach the value?

<ul class="nav">
  <?php
    include('../db.php');
    $query = "SELECT * FROM sizes";
    $stmt = $con->prepare($query);
    $stmt->execute();
    while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){  
      echo '<li>';
        echo $row['Size'];
        echo '<input type="hidden" name="sizeid[]" value="'.$row['ID'].'">';
        echo '<ul>';
          $colorquery = "SELECT * FROM `colors`";
          $colorstmt = $con->prepare($colorquery);
          $colorstmt->execute();
          while ($colorrow = $colorstmt->fetch(PDO::FETCH_ASSOC)){  
            echo '<li>
                    <label>
                      <input name="color[]" type="checkbox">'.$colorrow['Color'].'
                    </label>
                    <input type="number" name="quantity[]">
                  </li>';
          }
        echo '</ul>';
      echo '</li>';
    }

Result

how can i get the values from this section? i can't detach From what quantity, which colour and how many texture. Found the value but i have no idea about which thing is belgons some. Ex: Size S, Color Black:5; Color White:6 SizeM, Color Black:3 etc.

Aucun commentaire:

Enregistrer un commentaire