nao consigo inserir um botão para editar na minha tabela php
<?php
require_once('includes/db.php');
$id = $_GET['ID'];
$deleta = mysql_query("DELETE FROM fornec WHERE ID = '$id'");
if($deleta == ''){
echo "<script>alert('Houve um erro ao deletar!');
location.href=\"listar_fornec?pagina=inscricao\"</script>";
}
else{
echo "<script>alert('Registro excluido com sucesso!')";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
$titulo = "Controle » Listar Material";
require_once ("includes/header.php");
?>
</head>
<title> </title>
<style>
table {
border-collapse: collapse;
width: 100%;
}
th, td {
text-align: left;
padding: 8px;
}
tr:nth-child(even){background-color: #f2f2f2}
th {
background-color: #4CAF50;
color: white;
}
</style>
</head>
<body>
<?php
require_once('includes/testes.php');
?>
<?php
// Conexão ao banco
require_once('includes/db.php');
?>
<div id="principal">
<form action="<?php $_SERVER['PHP_SELF']?>" method="post">
<fieldset>
<?php
echo"<table width='100%' border='1'>";
echo '<table>';
echo '<tr>';
echo'<td>ID</td>';
echo'<td>NOME</td>';
echo'<td>TELEFONE</td>';
echo'<td>Editar/excluir</td>';
echo '</tr>';
$res = mysql_query("SELECT * FROM fornec");
while($escrever=mysql_fetch_array($res)){
echo '<tr>';
echo '<td>'.$escrever["ID"].'</td>';
echo '<td>'.$escrever["NOME"].'</td>';
echo '<td>'.$escrever["FONE_2"].'</td>';
echo "<a href=\"funcoes.php?id=$id \">Deletar </a>";
echo '</tr>';
}
echo '</table>';
?>
</fieldset>
</form>
</div> <!-- Fim da div#principal -->
</body>
</html>Discussão (6)
Carregando comentários...