![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
11/01/2007, 16:36
|
![Avatar de ..::MaRcOs::..](http://static.forosdelweb.com/customavatars/avatar160721_6.gif) | | | Fecha de Ingreso: diciembre-2006
Mensajes: 328
Antigüedad: 18 años, 2 meses Puntos: 3 | |
Re: Parrafos de textos en sql... nueva_noticia.php
<?php
include ('config.php');
$query = ("SELECT * FROM autores ORDER BY id limit 10");
$result = mysql_query( $query );
if( !is_resource( $result ) ) {
die("Problema con el Query:".mysql_error());
}
while( $datos = mysql_fetch_array( $result ) ) {
echo '<div id="Layer1" style="position:absolute; width:539px; height:115px; z-index:1; left: 5px; top: 25px;">
<form name="form1" method="post" action="admin/procesa_nueva_noticia_general.php">
<table width="314" border="0" align="center" class="Estilo1">
<tr>
<td width="94">Titulo</td>
<td width="144"><input name="titulo" type="text" id="titulo" size="50"></td>
<td width="62"><input type="submit" name="Submit2" value="Agregar"></td>
</tr>
<tr>
<td>Fecha</td>
<td><input name="fecha" type="text" id="fecha" size="50"></td>
<td> </td>
</tr>
<tr>
<td valign="top">Contenido</td>
<td><textarea name="contenido" cols="46" rows="10" id="contenido"></textarea></td>
<td> </td>
</tr>
<tr>
<td>Autor</td>
<td><select name="autor" size="1" id="autor">
<option>'.$datos[nombre].'</option>
</select></td>
<td> </td>
</tr>
</table>
</form>
</div>'; }?> procesa_nueva_noticia.php
<?php
include ('config.php');
mysql_query("INSERT INTO noticias_generales (titulo, fecha, contenido, autor)
VALUES ('$_POST[titulo]', '$_POST[fecha]', '$_POST[contenido]', '$_POST[autor]') ");
?>
<script language="javascript">
alert("Nueva Noticia General Registrada Exitosamente...");
document.location = "../admin.php?modulo=panel_de_control";
</script>
en latabla estan todos esos campos en varchar 255 y el contenido esta en text pero siempre los parrafos quedan pegados...
otra cosita si ven q en el formulario se intenta cargar datos de una tabla q contienen una lista d elos autores de las noticias y solo sale 1 en lugar de creo 5 q hay....
salu2 |