<?php

$dbms = 'mysql';
$dbhost = 'localhost';
$dbport = '';
$dbname = 'wrestlingtitles_updates';
$dbuser = 'wrestlingtitles_read';
$dbpasswd = 'ranR@Nran';


$db = mysql_connect($dbhost, $dbuser, $dbpasswd);
mysql_select_db("wrestlingtitles_updates", $db);
$query_newsfeed = "SELECT DATE_FORMAT(date,'%a, %d %b %Y %T') AS rfcpubdate, country, title, link, description FROM updates";
$newsfeed = mysql_query($query_newsfeed, $db) or die(mysql_error());
 
###### $row_newsfeed = mysql_fetch_assoc($newsfeed);
 
$totalRows_newsfeed = mysql_num_rows($newsfeed);
 
print "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<rss version=\"2.0\" xml:lang=\"en\" xmlns:atom=\"http://www.w3.org/2005/Atom\">
 
<channel>

  <title>Wrestling-Titles.com Updates</title>
  <link>http://www.wrestling-titles.com/</link>
  <description>Updates for Pro-Wrestling Title Histories (Wrestling-Titles.com)</description>
  <language>en-us</language>

\n";
####### <image><url>http://www.websitename.org.uk/images/logo.gif</url><title>The Website News</title><link>http://www.websitename.org.uk/news.php</link></image>

while( $row_newsfeed = mysql_fetch_object( $newsfeed ) )
{


print "<item>\n";
print "<title>".$row_newsfeed->country.": ".$row_newsfeed->title."</title>\n";
print "<link>http://www.wrestling-titles.com".$row_newsfeed->link."#last</link>\n";
print "<description>".$row_newsfeed->description."</description>\n";
print "<pubDate>".$row_newsfeed->rfcpubdate." ".date('T')."</pubDate>\n";
print "<guid isPermaLink=\"true\">http://www.wrestling-titles.com".$row_newsfeed->link."</guid>\n";
print "</item>\n";
}
print "<atom:link href=\"http://www.wrestling-titles.com/updates.xml\" rel=\"self\" type=\"application/rss+xml\" />
</channel>
</rss>\n";
?>
<?php
mysql_free_result($newsfeed);
?>
