Ver Mensaje Individual
  #19 (permalink)  
Antiguo 09/03/2006, 11:55
silverrr111
 
Fecha de Ingreso: julio-2004
Mensajes: 45
Antigüedad: 19 años, 9 meses
Puntos: 0
Nada esto está muerto.
Vuelvo a postear el script para que veais como estoy ahora:

noticias.php
Código PHP:
<body>
<?php
include ("conexion.php");
$selec mysql_query("SELECT * FROM noticias ORDER BY id DESC");
while (
$row mysql_fetch_array($selec)) {
?>
    <table width="45%" border="1" cellspacing="0" cellpadding="0">
    <tr>
    <td><h3><?=$row[titulo]?></h3></td>
    </tr>
    <tr>
    <td><h5><?=$row[nom]?></h5></td>
    </tr>
    <tr>
    <td><?=$row[noticia]?></td>
    </tr>
    <tr>
    <a href="borrar.php?id=<? echo $row[id]; ?>">Esborrar</a>
    </tr>
    </table><br />
<?
    
}
?> 
</body>


borrar.php

Código PHP:
<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<?php
  $id
=$_POST['id'];
  include (
"conexion.php");
  
  
//echo $id
  //mysql_query("DELETE FROM noticias WHERE id='$id'",$connect) or die(mysql_error());
   
mysql_query("DELETE FROM noticias WHERE id='".$id."'");
  
//mysql_query("DELETE FROM noticias WHERE id='$id'",$connect);
  //header("location: noticias.php");
?>

</head>

<body>

</body>
</html>