I have this code where I create two columns of type="checkbox"
:
$tabela1 .= '<td> <input type="checkbox" name= "Id[]" value="'.$rows_cursos['Id'].'"></td>';
$tabela1 .= '<td> <input type="checkbox" name= "Id[]" value="'.$rows_cursos['Id'].'"></td>';
Then I do this update to the database table where I only assign this value to input type="checbox"
:
$registro = $_POST['Id'];
$tratamento = $_POST['Tratamento'];
$imagem = $_POST['Imagem'];
foreach($registro as $value) {
$conn->query("UPDATE RegistoManutencao SET Estado1 = 'Pendente', Estado = 'Concluido', Tratamento = '$tratamento', Imagem = '$imagem' WHERE Id=" . $value);
}
But when I put the visa in the% Pending it in the table it does checkbox
of that column and also inserts the Completed and if it does the same happens the same and I want you to only do the update in the one I put the visa to.
I put an example image where I select the pendant but in the table it inserts the pending and completed and should only insert what I select: