After a filter I have this form with the users and their services, what I am trying to do is send the information to delete the records with the parameters set in the form, in case it would be the User ID and the Service, enter the ones that are checked with check, that is, several records can be sent at the same time.
This is my form:
Myvariablesarelikethisinmyform:
<inputtype="checkbox" name="Check[]" class="checkbox1" <?php if ($retorno >= 1) { echo "checked='checked'"; } ?> value="<?php echo $IdUsuario; ?>">
<input name="IdUsuario" type="hidden" value="<?php echo $IdUsuario; ?>" />
<input name="IdServico" type="hidden" value="<?php echo $IdServico; ?>" />
<input name="IdInterface" type="hidden" value="<?php echo $IdInterface; ?>" /
I need to execute a loop
for an exclude from my BD
, but I can not do this loop, since I only get the variables coming from a form, is there any way to do it with only these variables ?
The variables I get are these:
$IdUsuario = (isset($_POST['IdUsuario'])) ? $_POST['IdUsuario'] : '';
$IdServico = (isset($_POST['IdServico'])) ? $_POST['IdServico'] : '';
My opt-out code looks like this:
$sql = "DELETE FROM 'gasUsuarioServico' WHERE 'IdUsuario' = :IdUsuario AND 'IdServico' = :IdServico";
$stm = $conexao->prepare($sql);
$stm->bindValue(':IdUsuario', $IdUsuario, ':IdServico', $IdServico);
$retorno = $stm->execute();