Cita:
Iniciado por KrowMx
Si te refieres a recorrer los 2 query hasta que no exista nada, una solución puede ser utilizar && AND en el while
while(($line = mysql_fetch_assoc($results) && ($line1 = mysql_fetch_assoc($results1)) {
echo "<noticia>";
echo "<titulo>" . $line["post_title"] . "</titulo>\n";
echo "<mensaje>" . $line["post_excerpt"] . "</mensaje>\n";
echo "<fecha>" . $line["post_date"] . "</fecha>\n";
echo "<imagen>" . $line["imagepath"] . "</imagen>\n";
echo "</noticia>\n";
}
Saludos
Lo he hecho como me dices pero me arroja en blanco la pagina
Código PHP:
$query = 'SELECT * FROM ex_posts WHERE post_type="post" AND post_status="publish" ORDER BY ID DESC';
$results = mysql_query($query);
$query1 = 'SELECT * FROM ex_awsompxgimagecaptions ORDER BY capid DESC';
$results1 = mysql_query($query1);
echo "<?xml version="1.0\" encoding=\"utf-8\"?>\n";
echo "<new>\n";
while(($line = mysql_fetch_assoc($results) && ($line1 = mysql_fetch_assoc($results1)) {
echo "<noticia>";
echo "<titulo>" . $line["post_title"] . "</titulo>\n";
echo "<mensaje>" . $line["post_excerpt"] . "</mensaje>\n";
echo "<fecha>" . $line["post_date"] . "</fecha>\n";
echo "<imagen>" . $line1["imagepath"] . "</imagen>\n";
echo "</noticia>\n";
}
echo "</new>\n";
mysql_close($link);
?>
Código:
while(($line = mysql_fetch_assoc($results)) && ($line1 = mysql_fetch_assoc($results1))) {
echo "<noticia>";
echo "<titulo>" . $line["post_title"] . "</titulo>\n";
echo "<mensaje>" . $line["post_excerpt"] . "</mensaje>\n";
echo "<fecha>" . $line["post_date"] . "</fecha>\n";
echo "<imagen>" . $line1["imagepath"] . "</imagen>\n";
echo "</noticia>\n";
}
Perdon ya esta era cuestion de parentesis faltaba alguno, ahora si me va bien GRACIAS!!!!!!!