ladedardar
Technical User
Hello all,
Wondering if you could help me I am using a flash component which requires me to have the XML used in a strict format like this;
<?xml version="1.0" encoding="utf-8"?>
<photos path="images/">
<photo name="photo1" url="photo1.jpg">This is photo1</photo>
<photos>
I am using PHP to output my mysql results in XML however I want the same format as above and I havent been able to do it here is my code...I thank you in advance for help
<?PHP
$link = mysql_connect("****","****","");
mysql_select_db("****");
$query = "SELECT ilink,image_name,description FROM gallery";
$results = mysql_query($query);
echo "<?xml version=\"1.0\"?>\n";
echo "<photos>\n";
while($line = mysql_fetch_array($results)) {
echo "<photo>" . $line["ilink"] . $line["image_name"] . $line["description"] . "</photo> \n";
}
echo "</photos>\n";
mysql_close($link);
?>
Wondering if you could help me I am using a flash component which requires me to have the XML used in a strict format like this;
<?xml version="1.0" encoding="utf-8"?>
<photos path="images/">
<photo name="photo1" url="photo1.jpg">This is photo1</photo>
<photos>
I am using PHP to output my mysql results in XML however I want the same format as above and I havent been able to do it here is my code...I thank you in advance for help
<?PHP
$link = mysql_connect("****","****","");
mysql_select_db("****");
$query = "SELECT ilink,image_name,description FROM gallery";
$results = mysql_query($query);
echo "<?xml version=\"1.0\"?>\n";
echo "<photos>\n";
while($line = mysql_fetch_array($results)) {
echo "<photo>" . $line["ilink"] . $line["image_name"] . $line["description"] . "</photo> \n";
}
echo "</photos>\n";
mysql_close($link);
?>