<? header('Content-type: text/xml'); ?>

<rss version="2.0">
<channel>
<title>Ninth Fret: New News</title>
<description>An Australian post-doc in Europe</description>
<link>http://www.ninth-fret.com/</link>
<copyright>Copyright me, 2005-2010</copyright>

<?PHP

// Turn off all error reporting
// error_reporting(0);

include '../resources/articlesAJ9.php';



//define some variables to be used later
	$username="ninth";
	$password="mangore76";
	$database="ninth_testfp";

//start a connection to the database server
	mysql_connect(localhost,$username,$password);

//select the database
	@mysql_select_db($database) or die( "Unable to select database");

//a query to ask for a list of New News articles
	$query = "SELECT `id` , `pdate` ".
		"FROM `content` ".
		"WHERE category = 'New' ".
		"ORDER BY `pdate` DESC ".
		"LIMIT 0 , 15";

//enact the query and put the result into the array called "$result"
	$result=mysql_query($query);

//close the connection
	mysql_close();

//we count the rows and call the answer $num
	$num=mysql_numrows($result);

//loop through all the articles in the category and have articles.php display them
		$i=0;
		while ($i < $num) {
			$id=mysql_result($result,$i,"id");
			xml_item($id);
			$i++;
			}

?>

</channel>
</rss>
