Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/07/2010, 10:20
Avatar de shakaran
shakaran
 
Fecha de Ingreso: agosto-2005
Ubicación: España - Ciudad Real
Mensajes: 374
Antigüedad: 18 años, 9 meses
Puntos: 7
Respuesta: Como hago esto??

Es sencillo, añade el segundo query dentro del bucle while tal y como comentas:
Código PHP:
Ver original
  1. $resultID = mysql_query("SELECT * FROM campos_dua", $linkID);
  2. while($row=mysql_fetch_array($resultID))
  3. {
  4.    $resultID2 = mysql_query("SELECT * FROM agentes", $linkID2);
  5.    while($row2=mysql_fetch_array($resultID2))
  6.    {
  7.         $xml_output .= "\t<DUA_CONTROL>\n";
  8.         $xml_output .= "<GLN_EMISOR_MENSAJE><![CDATA[".$row['GLN_EMISOR_MENSAJE']."]]></GLN_EMISOR_MENSAJE>";
  9.         $xml_output .= "<GLN_EMISOR_MENSAJE><![CDATA[".$row2['nombre']."]]></GLN_EMISOR_MENSAJE>";
  10.         $xml_output .= "\t</DUA_CONTROL>\n";
  11.    }
  12. }

Fíjate que también he eliminado las variables $query y $query2 ya que en realidad las puedes meter como parámetro directamente y ahorrarte declarar las variables.
__________________
Quijost Backend Engineer - www.quijost.com - Hosting rápido, eficiente y profesional
Blog: www.shakaran.net