elbekko wanted this so here it is:
rss.php
<?
header("Content-type: text/xml"); //Set the header to XML.
$data = mysql_connect("localhost", "username", "password");
mysql_select_db ("RSSdb"); //Connect to your database.
?>
<rss version="2.0">
<channel>
<title>News</title> // Your RSS title
<description>Latest News</description> // Description of RSS
<link>http://www.yoursite.com</link> // And link to your website.
<?
$query = "SELECT * FROM news ORDER BY id DESC LIMIT 5";//Orders 5 news posts by post id.
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result)){ //Set up a while loop
?>
<item>
<title><?=$row['title']; ?></title>
<author><?=$row['author']; ?></author>
<link>http://www.yoursite.com/viewNews.php
?id=<?=$row['id']; ?></link>
</item>
<?
}
echo '</channel>\n</rss>';
mysql_close($data);
?>
Now we include the RSS on your page with this code:
<link rel="alternate" type="application/rss+xml" title="News" href="http://www.yoursite.com/rss.php" />
RSS is pretty simple and easy to get the hang of once you grasp the concepts of XML.