Pues tengo el siguiente problema...
Hago una consulta a una BD. Les muestro parte del código
Código PHP:
$arrayEstados=array("edo1","edo2","edo3");
foreach($arrayEstados as $estado){
echo "<br>Estado en el array: ".$estado;
$sql = "SELECT * FROM ".TBL."
WHERE activo=1
AND estado = '".$estado."'
AND membresia NOT IN (".ARRAY_A.")
ORDER BY tipo=2 DESC, tipo = 3 DESC LIMIT 0,5";
if (($result = $db->sql_query($sql)) ){
while( $row = $db->sql_fetchrow($result) ){
$var_estado=$row['estado'];
$pixFolder = "http://www.miurl.com.mx/imagenes_anuncios/";
if($row['ver'] >= 2) $pixFolder = "http://www.miurl.com.mx/imagenes/anuncios/small/".(str_replace('-','/',$row['fecha_registro'])).'/';
$link="http://www.miurl.com.mx/anuncio/".$xhtmlSubIds[$row['subcategoria']]."/".$row['fecha_inicio']."/".$row['id']."/".toUrl($row['encabezado'],true).".html?llegada=milenio";
$BUFFER=$HTMLBODY_SIMPLE;
$imgsrc = $pixFolder.$row['imagen'];
$textart = validXHtml(htmlentities(strtolower(cutTextClean($row['encabezado'],18))));
$textanuncio= validXHtml(htmlentities(strtolower(cutTextClean($row['anuncio'],72))));
$BUFFER=str_replace("[[LINK]]",$link,$BUFFER);
$BUFFER=str_replace("[[IMG]]",$imgsrc,$BUFFER);
$BUFFER=str_replace("[[TITULO]]",$textart,$BUFFER);
$BUFFER=str_replace("[[ANUNCIO]]",$textanuncio,$BUFFER);
$BUFFER=str_replace("[[STATE]]",$estado,$BUFFER);
$HTMLBODY.=$BUFFER;
$BUFFER=$HTMLCSS.$HTMLHEAD.$HTMLBODY.$HTMLFOOT;
//echo "<br>consulte estado db: ".$var_estado;
} //end while
//$HTMLBODY=$BUFFER;
} //end if
else debug($db->sql_error());
$thefile='ARCHhtml_'.$estado.'.html'; //construye el nombre del html
wIframe($thefile, $BUFFER, $estado); // crea el html dentro de la funcion
Archhtml_edo1.html deberia contener 5 registros consultados de la bd donde mi campo estado = edo1
Archhtm2_edo1.html deberia contener 5 registros consultados de la bd donde mi campo estado = edo2
Y asi sucesivamente pero siempre obtengo en mis registros en todos los html la misma consulta. los 5 registros iguales en todos los html's
Espero me haya dado a entender gracias