-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformex.php
33 lines (32 loc) · 980 Bytes
/
formex.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
include 'conexao.php';
$id = $_GET['id'];
$sql = "SELECT Pergunta_idPerguntas FROM pergunta_formulario
WHERE Form_id = $id";
$con = $conn->query($sql) or die($conn->error);
$sql = "DELETE FROM pergunta_formulario WHERE Form_id=$id";
if ($conn->query($sql) === TRUE) {
$sql = "DELETE FROM formulario WHERE idFormulario=$id";
if ($conn->query($sql) === TRUE) {
while($dado = $con->fetch_array()){
$id = $dado['Pergunta_idPerguntas'];
$sql = "DELETE FROM pergunta WHERE idPerguntas=$id";
if ($conn->query($sql) === TRUE) {
} else {
echo "Erro: " . $sql . "<br>" . $conn->error;
}
}
} else {
echo "Erro: " . $sql . "<br>" . $conn->error;
}
?>
<script>
alert('Excluido com sucesso!');
window.location = 'Dados.php';
</script>
<?php
} else {
echo "Erro: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>