Ver Mensaje Individual
  #3 (permalink)  
Antiguo 02/06/2015, 09:48
xbquelle
 
Fecha de Ingreso: junio-2015
Mensajes: 3
Antigüedad: 8 años, 11 meses
Puntos: 0
Respuesta: al intentar eliminar un registro de una tabla me elimina siempre el último

Gracias me has dado una pista y me ha servido de ayuda, al final lo he puesto así:

<div style="text-align:center;">
<table class="tabla_normal" align="center">
<tr style="background-color:#b08863; color:#FFF;">
<th>Borrar</th>
<th>Nombre máquina</th>
<th>Nº Serie</th>
<th>Fabricante</th>
</tr>

<?php
//Mostramos los registros
while ($row = mysql_fetch_array($resul))
{
?>
<form id="form_borra_maquinaria" action="borra_maquinaria_nuevo.php" method="post">
<tr><td><input type='hidden' name='id' value='<?php echo $row['numero_maquina']?>' />
<input class='buttonFormSmall' id='submit' type='submit' name='enviar' value='Borrar' title='Borrar'>
</td></form>

<?php
echo" <td align='center'>".$row['nombre_maquina']."</td>
<td align='center'>".$row['num_serie']."</td>
<td align='center'>".$row['fabricante']."</td>
</tr>";

}
mysql_free_result($resul);
?>
</table>

He puesto el <form> justo antes del botón de borrar el dato y el </form> justo después del botón. Y funciona perfecto. Muchas gracias