Tema: xml vacio
Ver Mensaje Individual
  #4 (permalink)  
Antiguo 30/12/2007, 19:18
Avatar de Marvin
Marvin
Colaborador
 
Fecha de Ingreso: febrero-2005
Ubicación: global $Chile->Santiago;
Mensajes: 1.991
Antigüedad: 19 años, 2 meses
Puntos: 81
Re: xml vacio

Si tu razonamiento para crear el xml esta ok. Prueba con esto:
Código PHP:
$texto '<gallery title="Navdeeps Gallery" thumbDir="img/galeria/thumb/" imageDir="img/galeria/" random="False">';

$maximcatSQL "SELECT Max(id) as numero
                FROM xmlcategories"
;
$maximcatR mysql_query($maximcatSQL);
while(
$maximcatData mysql_fetch_array($maximcatR)){
    for (
$i 1$i <= $maximcatData['numero']; $i++){
        
$nomcatSQL "SELECT name,dbase 
                    FROM xmlcategories WHERE id='$i'"
;
        
$nomcatR mysql_query($nomcatSQL);
        while(
$nomcatData mysql_fetch_array($nomcatR)){
            
$texto .= '
    <category name="'
.$nomcatData['name'].'">';
            
            
$maximimgSQL "SELECT Max(id) as num2 
                            FROM "
.$nomcatData['dbase'];
            
$maximimgR mysql_query($maximimgSQL);
            while(
$maximimgData mysql_fetch_array($maximimgR)){
                for (
$x 1$x <= $maximimgData['num2']; $x++){
                    
$texto .= '
        <image>'
;
                    
$datosSQL ="SELECT date,title,thumb,img 
                                FROM "
.$nomcatData['dbase']."
                                WHERE id='$x'"
;
                    
$datosR mysql_query($datosSQL);
                    while(
$datosData mysql_fetch_array($datosR)){
                        
$texto.= '
            <date>'
.$datosData['date'].'</date>
            <title>'
.$datosData['title'].'</title>
            <desc>'
.$datosData['title'].'</desc>
            <thumb>'
.$datosData['thumb'].'</thumb>
            <img>'
.$datosData['img'].'</img>
        </image>'
;
                    }
                }
            }
            
$texto.= '
    </category>'
;
        }
    }
}

$texto.='
</gallery>'
;

echo 
$texto;

/*
$name_file="gallery_micropixel.xml";
$file=fopen($name_file,"w+");
fwrite ($file,$texto);
fclose($file);
*/ 
Suerte!
__________________
El que dice "Solo sé que nada sé", esta asumiendo que sabe algo.
Lea las FAQ's!