dimanche 20 septembre 2020

Multiple checkbox

I am printing my products as a boxes (checkbox) as per code below, then I need take the selected boxes and save in a different table called lotes.

How could be the code to send those selected boxes to table lotes?

<?php    
$result = $conn->query("SELECT * FROM product");    
?>

<tbody>
<div class="container-fluid">
<h5 class="mb-2">Produtos</h5>
<div class="row">
 
<?php
$i = 0;
while ($row = $result->fetch_array()) {
    $class = ($i == 0) ? "" : "alt";
    echo "<div class='col-md-2 col-sm-6 col-12'>
            <div class='info-box'>
                <input type='checkbox' name = ".$row['ring_number']." value=".$row['ring_number'].">&nbsp<span class='info-box-icon bg-info'><i class='far fa-envelope'></i></span>
               
                    <div class='info-box-content'><span class='info-box-text'>Brinco ID</span><span class='info-box-number'>".$row['ring_number']."</span></div></div></div>";

    $i = ($i==0) ? 1:0;
}
?>
    </div><button type="submit" class="btn btn-primary">Cadastrar</button> 
</form>
</div>
<br>
</tbody>
</table>

Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire