Comunidad de diseño web y desarrollo en internet online

variables dinámicas en php

Citar            
MensajeEscrito el 24 Nov 2006 06:53 pm
buenas, quiero algo como esto, pero NPI en php .. :crap:

Código :

i = 0;
while (fila = mysql_fetch_row(resultado)) {
   this["t"+i] = utf8_decode(fila[i]); //tipo AS2 .. intenté con $$var .. pero no logro captar la forma
   i ++;
}

La idea es sacar bloques de texto de una bd, para luego usarlas en un html.. de tipo t0, t1, t2, t3 ..etc

Código :

<?php
consulta en bd
 ?>
<div id="texto">
<p><?php t0 ?><strong><?php t1?><strong/></p>
... etc etc...
</div>
aunq me sale un error de no captar la variable dentro de esos bloques php, no se si funcione así ...
bueno, thx ^^

Por Acidbjazz

716 de clabLevel



Genero:Masculino  

Lima - Perú

firefox
Citar            
MensajeEscrito el 24 Nov 2006 07:29 pm
Hola,

y no puedes utilizar un array?

Código :

$i = 0;
while (fila = mysql_fetch_array($resultado)) {
  $t[$i] = utf8_decode(fila[$i]);
  $i++;
}


Un saludo.

Por dmvalverde

150 de clabLevel



Genero:Masculino  

Extremadura

firefox
Citar            
MensajeEscrito el 24 Nov 2006 07:41 pm
sip, me compliqué por las puras.. muchas gracias ....

Por Acidbjazz

716 de clabLevel



Genero:Masculino  

Lima - Perú

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.