mardi 23 mai 2017

Can't select multiple checkboxes in while loop

After using while loop,I only select first checkbox but I can't select multiple checkboxes in page. Plz solve this issue.

$get=mysqli_query($con,"select * from subjects where cour_id='$id'") or die(mysqli_error($con));
    while($data=mysqli_fetch_array($get))
    {
        ?>
        <div class="be-checkbox">
        <input id="check" type="checkbox" name="chk[]" value="<?php echo $data['sub_name'];?>">
        <label for="check"><?php echo $data['sub_name'];?></label>
        </div>
       <?php
    }




Aucun commentaire:

Enregistrer un commentaire