<?php
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
  header("Content-type: application/xhtml+xml");
}
else {
  header("Content-type: text/html");
}
?>

<rss version="2.0">
<channel>
<title>Zero Waste Western Australia</title>
<description>Local, national and international waste management and recycling news.</description>
<link>http://www.zerowastewa.com.au/</link>

<?php
mysql_connect"localhost", "leticia", "abk219") or die(mysql_error());

mysql_select_db("zero") or die(mysql_error());

$result = mysql_query("SELECT * FROM news ORDER BY date desc LIMIT 0, 15") 
or die(mysql_error()); 

while($row = mysql_fetch_array( $result )) {
  $headline = $row["headline"];
  $id = $row["id"];
  $pubDate = date("r", strtotime($row["date"]));

echo"
<item>
<title>$headline</title>
<link>http://www.zerowastewa.com.au/communication/news/article.php?artid=$id</link>
<pubDate>$pubDate</pubDate>
</item>";}?>  
</channel>
</rss>




