Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/10/2012, 01:05
sdomenech
 
Fecha de Ingreso: enero-2011
Mensajes: 7
Antigüedad: 13 años, 4 meses
Puntos: 0
Información importar BD con sus parrafos

Buenas necesito de vuestros conocimientos...
Creo que estoy usando mal un codigo que os marcao en rojo para que al importar de la base de datos esta me la escriba con sus parrafos y no en bloque os dejo parte del codigo donde creo me estoy equivocando.

Código PHP:
Ver original
  1. Donde recogo la conexión de la base de datos:
  2.  
  3. <?php
  4. include("Connections/");
  5. mysql_query("SET NAMES 'utf8'");
  6. mysql_select_db($database_base de datos, $base de datos);
  7. $queEmp = "SELECT * FROM new ORDER BY titular ASC";
  8. $resEmp = mysql_query($queEmp,base de datos) or die(mysql_error());
  9. $totEmp = mysql_num_rows($resEmp);
  10.  
  11. $idNoticia1="1";
  12. $idNoticia2="2";
  13.  
  14. $titularNoticia1="";
  15. $titularNoticia2="";
  16.  
  17. $contenidoNoticia1="";
  18. $contenidoNoticia2="";
  19.  
  20.  
  21. if ($totEmp> 0) {
  22.  while ($rowEmp = mysql_fetch_assoc($resEmp)) {
  23.           [COLOR="Red"] {echo '';
  24.   echo nl2br( $rowEmp["noticia"] );
  25.   echo '';  }[/COLOR]
  26.   if($rowEmp['id_noticia'] == $idNoticia1){
  27.    $titularNoticia1=$rowEmp['titular'];
  28.    $contenidoNoticia1=$rowEmp['noticia'];
  29.   }
  30.   if($rowEmp['id_noticia'] == $idNoticia2){
  31.    $titularNoticia2=$rowEmp['titular'];
  32.    $contenidoNoticia2=$rowEmp['noticia'];
  33.   }
  34.  }
  35. }
  36. ?>
  37.  
  38. Codigo html
  39.  
  40. <body>
  41.  
  42. <li><a name="aparrafo" id="aparrafo"></a><a href="#" onclick="items(1)"><strong class="blau_text2"><?php echo $titularNoticia1 ?></strong></a>
  43. </li>
  44.        <div id="item_1" class="contenidoItem"  style="display:block;">
  45.          <p align="justify">
  46.             <h13><?php echo $contenidoNoticia1;
  47.                                  [COLOR="Red"]echo nl2br( $rowEmp["noticia"] );[/COLOR] ?></h13></p>
  48. </div></ul>

Muchas gracias