I'm doing a form that takes information from a mysql database and php shows it in a form with checkboxes, my question is this:
How do I save each selected row in an array?
This is the code that creates each row of the form:
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['ID'] . "</td>";
echo "<td>" . $row['producto'] . "</td>";
echo "<td>" . $row['precio'] . "</td>";
echo "<td><input type='checkbox' name='name". $row['ID'] ."' value=". $row['ID'] ."></td>";
echo "</tr>";
}
echo "</table>";
echo "<input type='submit' name='enviar' value='enviar'>";
echo "</form>"; '