Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/04/2008, 12:23
nathy20
 
Fecha de Ingreso: febrero-2007
Mensajes: 1
Antigüedad: 17 años, 2 meses
Puntos: 0
eliminar registros en php

necesito eliminar registros de la base de datos a traves de el siguiente codigo:

eliminar.php

<?php
include('connexion.php');
$result=mysql_query("select * from eventos");
echo" <BR><BR><table width=\"550\" height=\"50\" borde bordercolor=\"#003399\" align=\"center\" border=\"2\">
<tr>
<td width=\"100\" height=\"90\" rowspan=\"2\" bgcolor=\"#003399\"><div align=\"center\"><img src=\"imagenes/unefa.png\" width=\"70\" height=\"80\" align=\"middle\" /></div></td>
<td width=\"300\" height=\"30\">
<p align=\"center\" class=\"Estilo3\">AUDITORIO ALÍ PRIMERA</p></TD>
<td width=\"100\" height=\"90\" rowspan=\"2\" bgcolor=\"#003399\"><div align=\"center\"><img src=\"imagenes/pasillo3.jpg\" width=\"90\" height=\"80\" align=\"middle\" /></div></td>
</tr>
<tr>
<td bgcolor=\"#0066FF\"><div align=\"center\" class=\"Estilo1\">";
setlocale (LC_TIME,"spanish");
echo"<div align=right><strong>";
echo strftime("%d de %B del %Y");
echo"</strong></div>";
echo" </div>
</td>
</tr>
</table>
<table background=\"imagenes/Auditorio1.jpg\" width=\"550\" height=\"50\" borde=\"0\" bordercolor=\"#003399\" align=\"center\">
<tr>
<td colspan=\"2\"><p>
<table width=\"550\" height=\"100\" border=\"0\" align=\"center\">
<br><tr>
<td>
<p align=\"center\"><strong><font size=5 color=\"0033cc\">Eliminar Evento</font></strong></p>
<center><TABLE BORDER=1 CELLSPACING=2 CELLPADDING=4>
<TR>
<TD bgcolor=\"#003399\"><font color=\"#FFFFFF\"><strong>&nbsp;<B>codigo evento</B></strong></font></TD>
<TD bgcolor=\"#003399\"><font color=\"#FFFFFF\"><strong>&nbsp;<B>Fecha</B></strong></font></TD>
<TD bgcolor=\"#003399\"><font color=\"#FFFFFF\"><strong>&nbsp;<B>Nombre</B></strong></font>&nbsp;</TD>
<TD bgcolor=\"#003399\"><font color=\"#FFFFFF\"><strong>&nbsp;<B>Borrar</B></strong></font>&nbsp;</TD>
</TR>";
while($row = mysql_fetch_array($result)) {
printf("<tr><td>&nbsp;%s</td><td>&nbsp;%s&nbsp;</td><td>&nbsp;%s&nbsp;</td><td><a href=\"borra.php?id=?\">Borra</a></td></tr>", $row["id_evento"],$row["fecha"],$row["nombre_evento"],$row["ID_Prueba"]);
}
mysql_free_result($result);
echo"</TABLE></center>
<br>
<table width=\"530\" border=\"0\" align=\"center\">
<tr>
<td>
<center><input name=\"boton\" type=\"button\" onClick=\"javascript:history.go(-1)\" value=\"Cancelar\" />
</td>
</tr><br>
</table></center>
</form>
<tr>
<td colspan=\"2\" bgcolor=\"#003399\">&nbsp;</td>
</tr>
<tr>
<td>
</table>
</table>";
?>


borrar.php

<?php
include('connexion.php');
// $link=Conectarse();
$id_evento=$_GET['id_evento'];
mysql_query("delete from eventos where where ID_Prueba = '$id_evento'");

header("Location:eliminar.php");
?>


pero no me elimina el registro y me aparece el siguiente mensaje de error:

Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\audiovisuales\borra.php:9) in C:\wamp\www\audiovisuales\borra.php on line 15
que es esta linea:
header("Location:eliminar.php");

por favor ayudenme