Here is the code
Code:
<?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>Feed title</title>
<description>A description of the feed contents</description>
<link>http://www.yoursite.com/</link>”;
mysql_connect("","","");
mysql_select_db("");
// Query database and select the last 10 entries.
$data = mysql_query(“SELECT * FROM hmr ORDER BY id DESC LIMIT 10”);
while($row = mysql_fetch_array($data))
{
// 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>Title Here</title>
<description><![CDATA[“.$row[entrytext].”]]></description>
<comments>http://www.yoursite.com/article.1
</item>”;
}
// substr can limit the number of characters. First number is starting point while the second number is number of
characters.
// otherwise just use $row[Intro].
// <guid> is an optional sub-element of <item> but recommended if you don’t want to receive a warning when
validating your RSS.
echo “
</channel>
</rss>”;
?>
And it can be found here..
feed://roomwatch.uuuq.com/feed.xml
Bookmarks