RSS PHP/MySQL not working
I cannot figure out why this rss document is not working!? Thankx for any further help:)
<?php
header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
// set RSS version.
echo "
<rss version=\"2.0\">";
// start the XML
echo "
<channel>
<title>CMD - Visual Interface Design</title>
<descritpion>Inspiratie</description>
<link>http://vakgroep.cmd.hro.nl/vid</link>";
// create a connection to your database.
require("myconnection.php");
// query database and select the last 10 entries.
$data = mysql_query("SELECT * FROM ul_posts ORDER BY post_id DESC");
while($row = mysql_fetch_array($data))
{
// convert database images data into actual image link
$row[post_foto01] = str_replace("images/", "http://vakgroep.cmd.hro.nl/vid/fotos/", $row[post_foto01]);
// continue with the 10 items to be included in the <item> section of the XML
echo "
<item>
<link>http://www.vakgroep.cmd.hro.nl/vid/tag.php?id=".$row[post_id]."</link>
<guid isPermaLink=\"true\">http://www.vakgroep.cmd.hro.nl/vid/tag.php?id=".$row[post_id]."</guid>
<title>".$row[post_title]."</title>
<description>".substr($row[post_content1],0,150)."</description>
</item>";
}
echo "
</channel>
</rss>";
?>
