Ver Mensaje Individual
  #4 (permalink)  
Antiguo 04/05/2010, 02:08
Avatar de Flow89
Flow89
 
Fecha de Ingreso: abril-2010
Ubicación: Valladolid
Mensajes: 346
Antigüedad: 14 años
Puntos: 1
Respuesta: Formato en PHP.

Y donde lo tengo que implementar exactamente? Porque he echo un par de pruebas y no me da error, pero tampoco coge los saltos de linea.

Te dejo mi codigo en index.php

En el head;
Código PHP:
      <?php
      
include ("conex.php");
      
//hacemos las consultas
      
$result=mysql_query("select * from noticias order by fecha Desc limit 5"$connect);
      
$totalregistros=mysql_num_rows($result);
      
$resultado=mysql_query("select titulo from noticias order by fecha Desc limit 5"$connect);
      
$totalregistros2=mysql_num_rows($resultado);
      
?>
En el body
Código PHP:
<?php
      
//Recogemos las consultas en un array y las mostramos
      
while($row=mysql_fetch_array($result)) {
      
$TextoFN str_replace("\n","<br>"mysql_fetch_array($result));
      echo 
"<span class=\"Estilo35\"><img src=\"imagenes/prueba2.png\" width=\"50\" height=\"50\">" .$row[titulo]."</span><br><p>" .$row[noticia]."</p><br><div> Por: ".$row[autor]." | "
      
.date("d-m-Y",$row[fecha])." | Categoria: ".$row[categoria]." | <a href=\"noticias/editar.php?id=".$row[id_noticia]."\">editar</a></div><br><div align=\"center\"><img src=\"imagenes/separador.png\" width=\"400\" height=\"15\"></div>";
      }
      
mysql_free_result($result)
?>