Hi... I've not worked with PHP/MySQL creating RSS feeds before and can not understand why the below script will not update via Outlook or any other RSS content grabber...
Any idea's how to amend it?
The title of the file is rss.php
<?php
//SET XML HEADER
header('Content-type: text/xml');
//VARS
$mysql_host = "localhost";
$mysql_username = "username";
$mysql_password = "password";
$mysql_database = "default";
$home_url = "http://www.url.com";
$date = date("D, d M Y H:i:s T");
//CONNECT TO MYSQL
mysql_connect("$mysql_host", "$mysql_username", "$mysql_password") or die("Cannot connect to MySQL");
mysql_select_db("$mysql_database") or die("cannot select DB");
//TABLE CONNECT
$queryNews="SELECT * FROM news ORDER BY newsId DESC LIMIT 30";
$resultNews=mysql_query($queryNews)or die(mysql_error());
//CONSTRUCT RSS FEED HEADERS
$output = '<rss version="2.0">';
$output .= '<channel>';
$output .= '<title>Your RSS Feed Name or Website Name</title>';
$output .= '<description>A description of your feed or site.</description>';
$output .= '<link>http://www.yoursite.com/</link>';
$output .= '<copyright>Your copyright details</copyright>';
//BODY OF RSS FEED
while ($rowNews=mysql_fetch_array($resultNews))
{
$output .= '<item>';
$output .= '<title>' . $rowNews['newsId'] . '</title>';
$output .= '<link>' . $home_url . '</link>';
$output .= '<description>' . $rowNews['newsTitle'] . '</description>';
$output .= '<pubDate>' . $date . '</pubDate>';
$output .= '</item> ';
}
//CLOSE RSS FEED
$output .= '</channel>';
$output .= '</rss>';
//SEND COMPLETE RSS FEED TO BROWSER
echo($output);
?>