I looked up some questions here on the site, but I could not quite understand. I have several checkboxes like this:
<td>
<label class="ls-label-text">
<input type="checkbox" name="adicional" value="L. Ninho" id="2.00">
L. Ninho
</label>
</td>
<td>
<label class="ls-label-text">
<input type="checkbox" name="adicional" value="Kit Kat" id="2.50">
Kit Kat
</label>
</td>
<td>
<label class="ls-label-text">
<input type="checkbox" name="adicional" value="Confete" id="2.00">
Confete
</label>
</td>
In a form, and I send that data to the database, only when I send it, it just sends a checkbox , it does not send all the selected ones.
My action code is this:
<?php
include "../../lib/inc_con.php";
session_start();
$mesa = $_POST['mesa'];
$tamanho = $_POST['tamanho'];
$quantidade = $_POST['qtd'];
$adicional = $_POST['adicional'];
$hiddentotal = $_POST['hiddentotal'];
$data = date('Y-m-d H:i:s');
$produto_id1 = $_POST['produto_id1'];
$atendente_id = $_SESSION['id'];
$sql = mysql_query("INSERT INTO pedidos (mesa, tamanho, qtd, adicional, hiddentotal, data, produto_id1, atendente_id) values ('$mesa', '$tamanho', '$quantidade', '$adicional', '$hiddentotal', '$data', '$produto_id1', '$atendente_id')") or die (mysql_error());
?>