Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/04/2005, 16:25
Avatar de FuLaNo_
FuLaNo_
 
Fecha de Ingreso: mayo-2003
Ubicación: Don Torcuato, Buenos Aires, Argentina
Mensajes: 1.250
Antigüedad: 23 años, 5 meses
Puntos: 2
podrias hacer algo así

Código PHP:
$salto = 0;
while(
$row=mysql_fetch_array($sql)) {
if (
$salto <= "4") { $texto .= $row['campo'].'&nbsp;'; $salto = $salto + 1; }
if (
$salto >= "5") { $texto .= '<br>'; $salto = 0; }
}
echo 
$texto; 
eso haria que cada 5 textos de un salto, algo asi
texto1 texto2 texto3 texto4
texto5 texto6 texto7 texto8....

http://www.solo-racing.com.ar/probando.php ahi tienes un ejemplo, el codigo que use fue este:
Código PHP:
<?
//CONEXION DB
$sql = mysql_query("SELECT * FROM noticias ORDER BY id DESC LIMIT 0,50");
$salto = 0;
while(
$row=mysql_fetch_array($sql)) {
if (
$salto <= "4") { $texto .= $row['titulo'].' <> '; $salto = $salto + 1; }
if (
$salto >= "5") { $texto .= '<br><br>'; $salto = 0; }
}
echo 
$texto;
?>
A los espacios en blancos le agrege <> para que se noten bien, y en lugar de dar 1 salto da 2... es para motraste mejor como queda.

Saludos.
__________________
I Love Programming...