voila je fais un xml à la volée avec une page php
Resultat du xml avec mon code php
<?xml version="1.0" encoding="UTF-8"?>
<photoalbum>
<parameters bigframeheight ="410" bigframewidth ="500"
noofcolumn="5" noofrow="50" thumbxs="10" thumbys="220" thumbwidth="70"
thumbheight="70" albumnamesxs="400" albumnamesys="220"
albumnamescolor="0x000000"/>
<album albumname="deuxieme">
<images>
<image imagename="JL2.jpg" infotext="description 02"/>
</images>
</album>
<album albumname="deuxieme">
<images>
<image imagename="JL3.jpg" infotext="description 02"/>
</images>
</album>
<album albumname="premier">
<images>
<image imagename="F35AE.jpg" infotext="description 01"/>
</images>
</album>
<album albumname="premier">
<images>
<image imagename="F357E.jpg" infotext="description 01"/>
</images>
</album>
</photoalbum>
mon code php
<?PHP
$link = mysql_connect("localhost","root","");
mysql_select_db("any");
$query = 'SELECT clts.img, clts_nom.user, clts_nom.descrip FROM clts, clts_nom WHERE clts_nom.user = clts.nom ORDER BY user';
$results = mysql_query ($query);
//$titel = mysql_query ($query);
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<photoalbum>\n";
echo "<parameters bigframeheight =".'"'. '410' .'"'." bigframewidth
=".'"'. '500' .'"'." noofcolumn=".'"'. '5' .'"'." noofrow=".'"'. '50'
.'"'." thumbxs=".'"'. '10' .'"'." thumbys=".'"'. '220' .'"'."
thumbwidth=".'"'. '70' .'"'." thumbheight=".'"'. '70' .'"'."
albumnamesxs=".'"'. '400' .'"'." albumnamesys=".'"'. '220' .'"'."
albumnamescolor=".'"'. '0x000000' .'"'."/>\n";
while($imag = mysql_fetch_array ($results))
{
echo "<album albumname=".'"'. $imag ["user"].'"'. ">\n";
echo "<images>\n";
echo "<image imagename=".'"'. $imag ["img"].'"'.' '."infotext=".'"'. $imag ["descrip"].'"'. "/>\n";
echo "</images>\n";
echo "</album>\n";
}
echo "</photoalbum>\n";
mysql_close($link);
?>
le xml devrait avoir cette geule la
<?xml version="1.0"?>
<photoalbum>
<parameters bigframeheight ="410" bigframewidth ="500"
noofcolumn="5" noofrow="50" thumbxs="10" thumbys="220" thumbwidth="70"
thumbheight="70" albumnamesxs="400" albumnamesys="220"
albumnamescolor="0x000000"/>
<album albumname="deuxieme">
<image imagename="JL2.jpg" infotext="description 02"/>
<image imagename="JL3.jpg" infotext="description 02"/>
</images>
</album>
<album albumname="premier">
<image imagename="F35AE.jpg" infotext="description 01"/>
<image imagename="F357E.jpg" infotext="description 01"/>
</images>
</album>
</photoalbum>
j'arrive pas a savoir si je fais une erreur dans la requette mysql
ou dans la boucle while ou les deux !!!
si quelqu'un a une ideé
merci
King saiz
ps ce xml est fait pour afficher des données dans flash
kingsaiz