Ver Mensaje Individual
  #10 (permalink)  
Antiguo 13/03/2009, 12:08
lalo0002
(Desactivado)
 
Fecha de Ingreso: diciembre-2008
Ubicación: Trujillo - Peru
Mensajes: 341
Antigüedad: 15 años, 4 meses
Puntos: 2
Respuesta: Modificar o eliminar en una tabla

amigos alli ta mi codigo, ¿como llamo al boton eliminar el usu_id para poder guardarlo en una variable y usarlo en el delete?

Código HTML:
 <form action="procesos php/EliminarTiempo.php" method="post">	
  	
    <table width="700" border="0" align="center" >
      <tr>
        <td width="62" class="tb_lista_tiempos">Nro</td>
        <td width="99" class="tb_lista_tiempos">ID</td>
        <td width="203" class="tb_lista_tiempos">Nombres</td>
        <td width="76" class="tb_lista_tiempos">Tiempo</td>
        <td width="94" class="tb_lista_tiempos">Fecha</td>
        <td width="70">&nbsp;</td>
        <td width="66">&nbsp;</td>
      </tr>
      <?php
	  include('procesos php/listatiempos.php');
	
      while ($row = mysql_fetch_array($resultado))
		{
	  ?>
      <tr>
        <td class="tb_lista_tiempos_fila"><?php echo 1 ?></td>
        <td class="tb_lista_tiempos_fila"><?php echo $row['usu_id']; ?></td>
        <td class="tb_lista_tiempos_fila"><?php echo $row['nombres']; ?></td>
        <td class="tb_lista_tiempos_fila"><?php echo $row['tiempo']; ?></td>
        <td class="tb_lista_tiempos_fila"><?php echo $row['tie_fecha']; ?></td>
        <td><input type="submit" name="button" id="button" value="Modificar" class="boton_modificar" /></td>
        <td><input type="submit" name="boton[<?php echo $row['usu_id']; ?>]" value="Eliminar" ></td>
      </tr>
      <?php } ?>
    </table>
  </form> 
aqui toy q pruebo si me manda el usu_id y q lo reporte con echo pero no me manda nada
Código PHP:
<?php 
//Haciendo una conexion, y revisandola
include('Conexion.php');
$botonx $_POST['boton'];
echo  
$botonx;

//if($_POST['boton'] == 'Eliminar') {
//  //elimino
//  $resultado =@mysql_query("delete from tabla where usu_id=".$_GET['usu_id']"");
//  
//} elseif ($_POST['boton'] == 'Modificar') {
//  //modifico
}
algo q deba modificar o agregar para q funcione bn amigos ?

gracias