Ver Mensaje Individual
  #20 (permalink)  
Antiguo 17/09/2010, 09:15
tango84
 
Fecha de Ingreso: septiembre-2010
Mensajes: 37
Antigüedad: 13 años, 7 meses
Puntos: 0
Respuesta: Borrar archivos asociados a una base de datos

el codigo quedo asi:
<?php
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=%d&imagen=%s\">Borrar</a></td></tr>", $row["id"],$row["imagen"],$row["informacion"],$row["id"],$row["imagen"]);
}
mysql_free_result($result);
mysql_close($link);
?>

___________________________________________

<?php
include("conex.php");
$link=conectarse();
$id= $_GET['id'];
$imagen = $_GET['imagen'];

mysql_query("delete from galeria where id = $id",$link) or die(mysql_error());
unlink("./autoad/".$imagen);
header("Location:formulario.php");

?>