Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/09/2004, 10:57
ferranWEB
 
Fecha de Ingreso: enero-2002
Mensajes: 1.872
Antigüedad: 22 años, 3 meses
Puntos: 3
Ayuda con bucle....

Buenas, estoy implementando con php un codigo de tickers para noticias que he encontrado en html. tengo lo siguente:

$sql = "SELECT * FROM noticias WHERE idnoticia='1'";
$result = mysql_query($sql);

<?while ($noticia= mysql_fetch_array($result)){?>
onload = init
function init() {
ticker.activate()
}

var i0= "<a class='link_noticias' href='noticia1.htm' target='_top'><?echo $noticia["titulo"];?></a>";
<?
}
?>

hasta aqui perfecto, pq esto me muestra la noticia sin ningun problema.mi duda es que mo se cuantas noticias habran, por lo cual me gustaria ir llenando la varible var con otras noticias (var i1, i2, etc...), tantas variables como noticias hayan... como consigo hacer esto?? en html seria algo asi...

var i1= "<a class='link_noticias' href='noticia1.htm' target='_top'>noticia2</a>";

var i2= "<a class='link_noticias' href='noticia1.htm' target='_top'>noticia3</a>";

salu2