[Resolvido] Excluir Cadastro no Banco PHP
Não funciona dá certo fica na mesma tela mais não apaga no banco de dados.
<?
include "includes/CBanco.php";
$sql = new CBanco();
if($ok=="Sim"){
$query="SELECT * FROM noivo WHERE id='$_GET[id]'";
$result=$sql->Query($query);
$ln=$sql->fetch($result);
$query=$sql->query("DELETE FROM noivo WHERE id='$_GET[id]'");
?>
<script>
alert('Casamento excluido com sucesso!');
window.location.href="index2.php?pag=<?='casamento'?>&id=<?=$_GET[id_gal]; ?>";
</script><?
} else if($ok=="Não"){
?>
<script>
window.location.href="index2.php?pag=<?='casamento'?>&id=<?=$_GET[id_gal]; ?>";
</script><?
}
$query="SELECT * FROM noivo WHERE id='$_GET[id]'";
$result=$sql->Query($query);
$ln=$sql->fetch($result);
?>
<form action="" method="post">
<table width="583" height="159" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><span class="style3"> Excluir </span> </td>
</tr>
<tr>
<td valign="top"><hr color="#7FBAE2" style="height:1px"></td>
</tr>
<tr>
<td valign="top"></td>
</tr>
<tr>
<td valign="top" height="4"></td>
</tr>
<tr>
<td valign="top">
<p>
<?php
$cor = "#FFFFFF";
$cor1 = "#EEEEEE";
?>
</p>
<table width="100%" border="0" align="left">
<tr>
<td colspan="2" align="center">
<p><?=$ln[nome]; ?> e <?=$ln[noiva]; ?>
<p></p></td>
</tr>
<tr bgcolor="<? echo $cor1; ?>">
<td colspan="2" align="center">
<div align="center"><span class="style3"> Confirma a Exclusão</span> </div></td>
</tr>
<tr bgcolor="<? echo $cor1; ?>">
<td align="center">
<div align="right">
<input type="submit" name="ok" value="Sim" style="border:none; background: url(img/fsubmit.jpg); height:20px; color:#FFFFFF; font-size:10px; font: italic" />
</div></td>
<td align="center"><div align="left">
<input name="ok" type="submit" id="ok" style="border:none; background: url(img/fsubmit.jpg); height:20px; color:#FFFFFF; font-size:10px; font: italic" value="Não" />
</div></td>
</tr>
</table>
<p> </p>
</td>
<td align="left">
</table>
</form>
Quem pode me dar uma mão?
Discussão (4)
Carregando comentários...