0
My intention is that when you delete a bill, it goes back to the index page of notes referring to that work.
Code:
{
$id = $_POST['id'];
$ok = $_GET['obra'];
//Delete do banco:
$pdo = Banco::conectar();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "DELETE FROM notas where id = ?";
$q = $pdo->prepare($sql);
$q->execute(array($id));
Banco::desconectar();
header('Location: index01.php?obra=' . $ok);
}
The way to concatenate the values is correct. Is there a problem executing it?
– Valdeir Psr
Although I’m testing the variable and it’s showing value, this header is not, it goes back to the page without value! so I don’t know exactly what’s going on!
– LuDi Carvalho