Código PHP:
<?php
$consulta2 ="select artista, cancion, url from canciones where genero='Cumbia'";
$resultado2=mysql_query($consulta2);
$num_resultados2 = mysql_num_rows($resultado2);
?>
<?php
if(!$num_resultados2)
{
echo "<BR><span class=\"flames\"><font color=\"#FF6600\">No Hay Resultados ."</b></font><BR></span>";
}
else
{
while($row=mysql_fetch_array($resultado2)){;
$buffer = '<?xml version="1.0" encoding="UTF-8"?>
<songs>
<song path="'.stripslashes($row["url"]).'" artist="'.stripslashes($row["artista"]).'" title="'.stripslashes($row["cancion"]).'" />
</songs>
';
}
$name_file="list.xml";
$file=fopen($name_file,"w+");
fwrite ($file,$buffer);
fclose($file);
}
?>