Ver Mensaje Individual
  #6 (permalink)  
Antiguo 28/03/2010, 10:44
Avatar de dargor
dargor
 
Fecha de Ingreso: octubre-2009
Mensajes: 134
Antigüedad: 14 años, 7 meses
Puntos: 2
Respuesta: convertir php a xml

yo he logrado satisfactoriamiente crear un archivo xml con esta funcion. este codigo es segun lo que yo necesitaba, modificalo al tuyo.

Código:
function CrearXML (){
     $dbcon=AQUI TU CONEXION A LA BASE DE DATOS
    $resul=mysql_query('SELECT * FROM productos ORDER BY `CORRELATIVO`',$dbcon);


$buffer='<gallery>
            ';
  while ($row=mysql_fetch_array($resul)):
    $buffer.="<slide>
                <image>thumbs/$row[1]</image>
                <title>$row[1]</title>
                <description>$row[1]</description>
                <link>productos/$row[1]</link>
                <target>_blank</target>
              </slide>
              ";
  endwhile;
  $buffer.="</gallery>";
  $file=fopen("slide.xml","w+");
  fwrite ($file,$buffer);
  fclose($file);
  
 }