Pee-H-Pee
09-25-2004, 02:28 PM
I am trying to generate an XML feed from a MySQL database. It isn't working as I am sure I haven't made my script right. I would appreciate any help... here is my current script:
<? include("config.php"); ?>
<? header("Content-Type: text/xml"); ?>
<?
$result = mysql_query("select * from products ORDER by name ASC LIMIT 10") or die (mysql_error());
while ($row = mysql_fetch_array($result))
{
echo "<products>
<link>$row[link]</link>
<name>$row[name]</name>
<description>$row[description]</description>
</products>";
}
mysql_free_result($result);
?>
<? include("config.php"); ?>
<? header("Content-Type: text/xml"); ?>
<?
$result = mysql_query("select * from products ORDER by name ASC LIMIT 10") or die (mysql_error());
while ($row = mysql_fetch_array($result))
{
echo "<products>
<link>$row[link]</link>
<name>$row[name]</name>
<description>$row[description]</description>
</products>";
}
mysql_free_result($result);
?>