![de acuerdo](http://static.forosdelweb.com/fdwtheme/images/smilies/dedosarriba.png)
---------------------------------------------
la base de datos 'noticias'
tabla 'noticias2'
id int(10) No auto_increment
fecha char(20) Sí NULL
titulo char(50) Sí NULL
contenido char(100) Sí NULL
---------------------------------------------
![sonrisota](http://static.forosdelweb.com/fdwtheme/images/smilies/xD.png)
Tengo este código que no funciona desde un formulario que se auto rrellena con la informacion de la BD
formulario.php
<?php
if (isset($g_id))
$bd=@mysql_connect("localhost", "root", "xalma");
$sel=@mysql_select_db("noticias");
$busqueda= mysql_query("SELECT fecha,titulo,contenido,id FROM noticias2 WHERE id=$g_id");
while ($row = mysql_fetch_array($busqueda))
{
echo"
<form name=myf method=post action=Editar.php >
<input name='f_fecha' type=text value='$row[fecha]'>
<input name='f_titulo' value='$row[titulo]'>
<textarea name='f_contenido' >$row[contenido]</textarea>
<input type=submit value='Modificar'>
<input name=f_id type=hidden value='$row[id]' >
</form>
";
}
?>
![Pensando](http://static.forosdelweb.com/fdwtheme/images/smilies/scratchchin.gif)
Editar.php
if (isset($f_id))
{
$link = mysql_connect("localhost", "root");
mysql_select_db("noticias",$db);
$sql = "UPDATE noticias2 SET fecha='$f_fecha', titulo='$f_titulo'".
"contenido='$f_contenido' WHERE id=$f_id";
$result = mysql_query($sql);
}
else{
echo "Debe especificar un 'id'.\n";
}
![Golpeado](http://static.forosdelweb.com/fdwtheme/images/smilies/pelea.png)
![Golpeado](http://static.forosdelweb.com/fdwtheme/images/smilies/pelea.png)
![Golpeado](http://static.forosdelweb.com/fdwtheme/images/smilies/pelea.png)
![Golpeado](http://static.forosdelweb.com/fdwtheme/images/smilies/pelea.png)
![Golpeado](http://static.forosdelweb.com/fdwtheme/images/smilies/pelea.png)
Necesito que pueda modificar desde al formulario uno de las campor dando como referencia la id
![Aplauso](http://static.forosdelweb.com/fdwtheme/images/smilies/aplausos.gif)
[meta http-equiv='Page-Exit' content='progid:DXImageTransform.Microsoft.Gradien tWipe(duration=1.0, gradientsize=0.2)' /]