Aqui sta el codigo d cada uno:
elejir.php
Código PHP:
<?php
$conexion = mysql_connect("localhost", "root", "");
if (! $conexion)
{
echo "<h2 align='center'>ERROR: Imposible establecer conexión con el servidor</h2>";
exit;
}
mysql_select_db("test", $conexion);
$result = mysql_query("SELECT * FROM usuarios", $conexion);
echo "<center>Elige un registro de la lista para Modificar:<br></center><br><br>";
echo "<center><table border = '1' bgcolor='#ffffff'> \n";
echo "<form method='post' action='edita.php'>";
while ($row = mysql_fetch_row($result))
{
echo "<tr> \n";
echo "<td> <font color='#000000' size=3><input type=submit name='id' value=$row[0]> </font> </td> \n";
echo "<td> <font color='#000000' size=3> $row[1] </font> </td> \n";
echo "<td> <font color='#000000' size=3> $row[2] </font> </td> \n";
echo "<td> <font color='#000000' size=3> $row[3] </font></td> \n";
echo "<td> <font color='#000000' size=3> $row[4] </font></td> \n";
echo "<td> <font color='#000000' size=3> $row[5] </font></td> \n";
echo "</tr> \n";
}
?>
Código PHP:
<?php
$conexion = mysql_connect("localhost","root","") or die("No se pudo realizar la conexion con el servidor");
mysql_select_db("test") or die (mysql_error());
$busqueda="SELECT * FROM usuarios WHERE id ='$numero'";
$resultado_b=mysql_query($busqueda);
if($row=mysql_fetch_row($resultado_b))
{
echo "
<form name=formulario method=post action=modifica_registro.php>
<input type=hidden name='numero' value='$numero'>
<table border='0' width='769' cellpadding='0' cellspacing='1' >
<input type='HIDDEN' name='id' value='$row[0]' size='10' maxlength='10'>
<tr>
<td width='92' bgcolor='#CCCCCC' height='21'><b>Socios</b></td>
<td width='568' height='21'></td>
</tr>
<tr>
<td width='92' height='28'> Nombre </td>
<td width='568' height='28'> <input type=text value='$row[1]' size='75' maxlength='25' name='nombre'></td>
</tr>
<tr>
<td width='92' height='34'> Apellidos </td>
<td width='568' height='34'> <input type='text' name='apellidos' value='$row[2]' size='75' maxlength='50'></td>
</tr>
<tr>
<td width='92' height='34'> Edad </td>
<td width='568' height='34'> <input type='text' name='edad' value='$row[3]' size='6' maxlength='25'></td>
</tr>
<tr>
<td width='92' height='34'>
Telefono</td>
<td width='568' height='34'> <input type='text' name='telefono' size='5' maxlength='11' value='$row[4]'></td>
</tr>
<tr>
<td width='92' height='2'> Población</td>
<td width='568' height='2'> <input type='text' name='poblacion' size='23' maxlength='35' value='$row[5]'>
C.P. <input type='text' name='codpostal' size='5' maxlength='11' value='$row[6]'>
Provincia <input type='text' name='provincia' size='13' maxlength='11' value='$row[7]'>
<input type=submit value='Enviar >>'>
</td>
</tr>
</table>
</form>
";
}
?>

Código PHP:
<?php
$conexion = mysql_connect("localhost", "root","");
mysql_select_db("test",$conexion);
$consulta = "UPDATE usuarios SET nombre='$nombre', apellidos='$apellidos', edad='$edad' , telefono='$telefono', poblacion='$poblacion', provincia='$provincia' , codpostal='$codpostal' WHERE id='$numero'";
$resultado = mysql_query($consulta);
if ($resultado)
{
echo "<font color=ff0000 size=4> El registro ha sido Modificado </font>\n";
}
else
{
echo "<p>¡No se ha podido modificar.!</p>\n";
exit;
}
mysql_close($conexion);
?>