Lo que intento es cargar la información de la noticia ya entrada en un formulario
Código:
Y guardarla de nuevo en la BD:$conn = mysql_connect("localhost","xxx","xxx");
mysql_select_db("rkwfirjq_exiliumweb");
$id=$_GET['id'];
$noticias = mysql_query("select * from tbl_news WHERE news_id = $id", $conn);
while($noticia = mysql_fetch_array($noticias)) {
?>
<form action="index.php?menu=noticias&accion=editar&confirmar=si&id=<? echo $id ?>" method="post">
<table width="640" border="0">
<tr>
<td colspan="2" class="titulo"><div align="center">EDITAR NOTICIA</div></td>
</tr>
<tr>
<td width="175" class="texto"><div align="right">Tipo:</div></td>
<td width="455">
<select name="news_tipo" style="font-size:10px">
<option value="." selected>.</option>
<option value="noticia" selected>Noticia</option>
<option value="clanbase">ClanBase</option>
<option value="competiciones">Competiciones</option>
</select>
</td>
</tr>
<tr>
<td width="175" class="texto"><div align="right">Fecha:</div></td>
<td width="455"><input type="text" name="news_fecha" style="font-size:10px" value="<? echo $noticia["fecha"] ?>"></td>
</tr>
<tr>
<td width="175" class="texto"><div align="right">Título:</div></td>
<td width="455"><input type="text" name="news_titulo" style="font-size:10px" size="50" value="<? echo $noticia["titulo"] ?>"></td>
</tr>
<tr>
<td width="175" valign="top" class="texto"><div align="right">Texto:</div></td>
<td width="455">
<script type="text/javascript">
HTMLArea.loadPlugin("CharacterMap");
HTMLArea.onload = function() {
var editor = new HTMLArea("editor");
editor.registerPlugin(CharacterMap);
editor.generate();
}
HTMLArea.init();
</script>
<textarea id="editor" name="news_texto" cols="70" rows="20"><? echo $noticia["texto"] ?></textarea>
</td>
</tr>
<tr>
<td colspan="2" valign="top" class="texto"><div align="center">
<input type="submit" name="Submit" value="Guardar" style="font-size:10px">
</div></td>
</tr>
</table>
</form>
<?
}
mysql_close($conn);
Código:
Se muestra en el formulario pero al modificarla y darle a guardar... no me lo hace
$id=$_GET['id'];
$tipo=$_POST['news_tipo'];
$fecha=$_POST['news_fecha'];
$titulo=$_POST['news_titulo'];
$texto=$_POST['news_texto'];
$conn = mysql_connect("localhost","xxx","xxx"); // crea conexion
mysql_select_db("rkwfirjq_exiliumweb"); // conecta BD
mysql_query("update tbl_news SET tipo=$tipo, fecha=$fecha, titulo=$titulo, texto=$texto WHERE news_id = $id",$conn); // consulta
mysql_close($conn); // cierra BD
Alguien me puede hechar un cable?
Gracias




