0
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>';
and then 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 on checkbox
Pending it on the table makes the update
of that column and also inserts the Completed and if you do it the other way around, the same thing happens and I just want you to do the update on which I put the visa.
put an example image where I select the pendant but in the table it inserts the pendant and completed and should only insert what I select:
In his query you are informing him to define the Pending and Completed in the State and State fields respectively.
– Valdeir Psr
In the query of
update
am. In query query I have this waySELECT centrodb.RegistoManutencao.Id,
 DataRegisto,
 Pedido,
 Outro,
 Descricao,
 Funcionario,
 Imagem,
 Tratamento,Estado1,
 Estado

FROM centrodb.RegistoManutencao LEFT OUTER JOIN centrodb.InfoLuvas

ON centrodb.InfoLuvas.Id = centrodb.RegistoManutencao.Colaborador

WHERE Estado IS NULL;
– user104114