-1
I have a table of movies on my site that has the option to edit and delete. I’m having a hard time deleting the film from my chart. What I want to do is: When you click delete, it moves the row to another table of the same type by backing up. After it move, delete the row from the current table.
What I can’t do is pass the field id on the link. When I click the button to "delete" from the table, it does not pass the desired value, passing only the value 2.
Follows my code:
Boot
<a href="painel_adm_deletefilme.php?idFilme='.$dados['idFilme'].'"><input class="btn btn-danger" name="excluirFilme" value="Sim" class="btn btn-danger"></input></a>
painel_adm_deletefilme
<?php
session_start(); include_once 'connects Anco.php';
$id = $_GET["idFilme"];
$envia = "INSERT INTO filmesDelet (idFilme, filme, descricao, genero, anoLancamento, faixaEtaria, trailer)
SELECT idFilme, filme, descricao, genero, anoLancamento, faixaEtaria, trailer
from filmes where idFilme = '$id'";
$insere_bd = $conecta->prepare($envia);
if($insere_bd->execute()){
echo 'sucesso';
}else{
echo 'failed';
}
?>
The code does not return any error. It goes directly into the success if, and the table was not passed to the desired row. Whenever I click to "delete" it passes the id of value 2.
I will do as you said, set an attribute in the table and show according to the boolean value.
– Diego Souza