Ver Mensaje Individual
  #5  
Antiguo 05-07-2006
[Gunman] [Gunman] is offline
Miembro
 
Registrado: dic 2004
Ubicación: Pedreguer.
Posts: 355
Reputación: 22
[Gunman] Va por buen camino
Ya está listo...
Aquí pongo el código, por si se puede mejorar:
Código PHP:
if(isset($DeleteNews)){
        
$result=mysql_query("SELECT * FROM `news`");
        
$numrows=mysql_num_rows($result);
        
$i 0;
        
$t 0;        
        
$max $numrows;
        while(
$i<$numrows && $t<$max){
            
$id mysql_result($result$i"id");
            if(
$_POST["nw$id"]==true){
                
$result mysql_query("DELETE FROM `news` WHERE `id` = ".$id);
                if(
$result==1){
                  echo 
"<br>Notícia [".$id."] eliminada!";
                }else echo 
"<br>Error al eliminar la notícia!"
                
$result=mysql_query("SELECT * FROM `news`");
                
$numrows=mysql_num_rows($result);                
                
$i $i-1;                
            }
            
$i $i+1;
            
$t $t+1;
        }
    } 
__________________
l2prog.co.nr
Responder Con Cita