Vas bien esta todo bien solo que debe de haber un pequeño errorsillo por ahi puedes pasarme el codigo de los archivos que usas para editar y a lo mejor y veo el error
OK, gracias.
A ver, tengo eleccion.php:
<html>
<head>
<link rel="stylesheet" type="text/css" href="estyl.css" media="all" />
</head>
<body>
<form action="actualizar.php" method="get">
<?
$conectar = mysql_connect("localhost","gnomo", "britania98");
$bd = mysql_select_db ("perez_salinas");
$seleccionar = mysql_query ("SELECT * FROM mayo") or die ("Ha ocurrido un error al conectar a la bd");
$contando_registros = mysql_num_rows($seleccionar);
if($contando_registros <= 0)
{
echo "<td>No se han encontrado registros en la tabla</td></tr></table></form>";
}
else {
echo '<td>Selecciona el dia a actualizar</td>';
echo '<td>';
echo '<select name="id">';
if($contando_registros)
{
while ($registros = mysql_fetch_array($seleccionar))
{
echo '<option value="'.$registros['dia'].'">dia '.$registros['dia'].'</option> ';
}
}
echo '';
echo '</select>';
}
?>
<input type="submit" value="Editar">
</form>
</body>
</html>
Y esta a actualizar.php:
<html>
<head>
<link rel="stylesheet" type="text/css" href="estyl.css" media="all" />
</head>
<body>
<div id="cabezera"/>
<center><table border="1"/>
<tr>
<td>
[contenido no disponible]
</td>
<td>
[contenido no disponible]
</td>
<td>
[contenido no disponible]
</td>
<td>
<h1>ACTUALIZAR DATOS</h1>
</td>
<td>
[contenido no disponible]
</td>
<td>
[contenido no disponible]
</td>
</tr>
</table></center>
</div>
<hr/>
<?
$id= $_GET['id'];
mysql_connect("localhost", "gnomo", "britania98");
mysql_select_db("perez_salinas");
$obtener_id = mysql_query("SELECT * FROM mayo WHERE dia = '$id'") or die("Error en nueva.php");
if ($row = mysql_fetch_array($obtener_id)){
echo "<center> \n";
echo "<table border = '1'> \n";
echo "<tr> \n";
echo "<td>dia</td> \n";
echo "<td>cliente</td> \n";
echo "<td>descriccion</td> \n";
echo "<td>coche</td> \n";
echo "<td>dieta</td> \n";
echo "<td>a_cuenta</td> \n";
echo "</tr> \n";
do {
echo "<tr> \n";
echo "<td>".$row["dia"]."</td> \n";
echo "<td>".$row["cliente"]."</td> \n";
echo "<td>".$row["descriccion"]."</td> \n";
echo "<td>".$row["coche"]."</td> \n";
echo "<td>".$row["dieta"]."</td> \n";
echo "<td>".$row["a_cuenta"]."</td> \n";
echo "</tr> \n";
}
while ($row = mysql_fetch_array($obtener_id));
echo "</table> \n";
echo "
\n";
echo "</div> \n";
echo "<hr> \n";
}
else {
echo "¡ No se ha encontrado ningún registro !";
}
?>
<form action="actualizando.php" method="get">
<input type="hidden" name="id" value="<?=$id?>" />
<center>
Dia<input type="text" name="dia" style="margin:50px 10px" />
Cliente<input type="text" name="cliente" style="margin:50px 10px" />
Descriccion<input type="text" name="descriccion"style="margin:50px 10px" /></p>
Coche<input type="text" name="coche"style="margin:50px 10px" />
Dieta<input type="text" name="dieta"style="margin:50px 10px" /></p>
A/cuenta<input type="text" name="a_cuenta"style="margin:50px 10px" /></p>
<input type="submit" name="validar" value="Enviar" style="margin:50px 10px" />
</form>
</body>
</html>
Y por ultimo actualizando.php:
<html>
<head>
<link rel="stylesheet" type="text/css" href="estyl.css" media="all" />
</head>
<body>
<div id="cabezera"/>
<center><table border="1"/>
<tr>
<td>
[contenido no disponible]
</td>
<td>
[contenido no disponible]
</td>
<td>
[contenido no disponible]
</td>
<td>
<h1>SERVICIOS DE MAYO</h1>
</td>
<td>
[contenido no disponible]
</td>
<td>
[contenido no disponible]
</td>
</tr>
</table></center>
</div>
<hr/>
<?
$id = $_GET["id"];
$dia = $_GET["dia"];
$cliente = $_GET["cliente"];
$descriccion =$_GET["descriccion"];
$coche = $_GET["coche"];
$dieta = $_GET["dieta"];
$a_cuenta = $_GET["a_cuenta"];
mysql_connect ("localhost" , "gnomo" , "britania98");
mysql_select_db ("perez_salinas");
$actualizar = mysql_query ("UPDATE mayo SET dia = '$dia', cliente = '$cliente', descriccion = '$descriccion', coche = '$coche', dieta = '$dieta', a_cuenta = '$a_cuenta' WHERE id = '$id'") or die("Error en actualizando.php") ;
echo "<center><h1>EDITADO</h1></center>";
?>
<center><input type=button value=Volver onclick="history.go(-2)"/></center>
<script language="JavaScript" type="text/javascript"/>
</body>
</html>
¿A ver donde está mal?