Ver Mensaje Individual
  #16 (permalink)  
Antiguo 04/05/2012, 15:42
echo_
 
Fecha de Ingreso: noviembre-2011
Ubicación: Paris
Mensajes: 450
Antigüedad: 12 años, 5 meses
Puntos: 7
Respuesta: borrado de un registro

ya intente lo he puesto y me queda asi, pero sigue en las mismas :C insisto esta linea esta bien? <a href="index.php?id='.$row[0].'">, otra cosa la condicion donde se hace el delete tmb la e cambiado de lugar y nada

Saludos!!
Código PHP:
<html>
<head>


<script type="text/javascript">
function show_confirm()
{
var r=confirm("Estas seguro de borrar este registro!");
if (r==true)
  {
  
  window.location="index.php?action=delete&id="+id; 
  <?php
   
include ("config.php");

    
     if (isset (
$_GET['id']) || !empty ($_GET['id'])){
      
$id$_GET["id"];
     
$result=mysql_query("delete from usuarios WHERE id = '$id' ",$conexion);
 
$opt "OPTIMIZE TABLE usuarios";
$rop mysql_query($opt);
     }
    
?>
  
  alert("Ha borrado el Registro");
  }
else
  {
  alert("Ha cancelado el borrado!");
  }
}
</script>








<title>registros</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="contenido">
  <div id="cabecera"></div>
  <div id="separacion"></div>
  
  
  
  <?php
 
  
//Funcion para el cebreado cada 1   registro.
   
function alt ($cebra) {
   if (
$cebra/==               floor($cebra/2)) {
    return 
' class="a"';
    } else {
        return 
' class="b"';
    }
}
$cebra=1;



     
    


     
$result=mysql_query("SELECT * FROM usuarios ORDER BY id",  $conexion);
    
     
$num_results mysql_num_rows ($result);

     for( 
$i=1$i<=$num_results$i++ ) {  
     
      
$row mysql_fetch_array ($result);  
     
?>

  

  
  <div <?php echo alt($zebra); $zebra++;?>>
  <?php echo'<table width="596" border="0">
      <tr>
        <td width="58">'
.$row[0].'</td>
        <td width="142">'
.$row[1].'</td>
        <td width="125">'
.$row[1].'</td>
        <td width="117">'
.$row[3].'</td>
        <td width="120"><a href="index.php?id='
.$row[0].'"><img onclick="show_confirm()" value="Show a confirm box"  src="delete-32.png" width="16" height="16"></a><td width="160">  </td>
      </tr>
    </table>
  </div>'
;
  
  } 
  
  
//<a href="index.php?id='.$row[0].'">Mi enlace</a></td>
  
?>
<p>&nbsp;</p>
</div>
</body>
</html>