Here is my code
<?php
//header serts the http header to text/xml so the RSS reader knows tha tthe content type is XML
header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo"
<rss version=\"2.0\">";
//Start the XML
echo"
<channel>
<title>Feed title</title>
<description>A description of the feed contents</description>
<link>http://www.yoursite.com/</link>";
//above code creates the opening '<channel>' tag as well as the other elements.
require("mysql_connect.php");
//query db and select last 10 entries
$data = mysql_query("SELECT * FROM table ORDER BY id DESC LIMIT 10");
while($row = mysql_fetch_array($data))
{
//convert db images data into actual image link
$row[Intro] = str_replace("images/","http://www.yoursite.com/images/",
$row[Intro]);
// Continue with the 10 items to be included in the <item> section of the XML.
echo "
<item>
<link>http://www.yoursite.com/article.php?id=".$row[id]."</link>
<guid isPermaLink=\"true\">http://www.yoursite.com/article.
php?id=".$row[id]."</guid>
<title>".$row[Title]."</title>
<description><![CDATA[".$row[Intro]."]]></description>
<comments>http://www.yoursite.com/article.php?id=".$row[id]."#Comments</
comments>
</item>";
}
echo "
</channel>
</rss>";
?>
It is connected to a database table, whose table name is ORDER with columns id,title,intro, however the RSS feed on the next page does not load up the items stored in the DB, any idea why?
Cheers.
Thanks.