Har endelig fundet en løsning der ser således ud:
http://www.jensjungersen.dk/rss.php<?php
header("Content-Type: application/rss+xml; charset=ISO-8859-1");
DEFINE ('DB_USER', 'user');
DEFINE ('DB_PASSWORD', 'password');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'database');
$rssfeed = '<?xml version="1.0" encoding="ISO-8859-1"?>';
$rssfeed .= '<rss version="2.0">';
$rssfeed .= '<channel>';
$rssfeed .= '<title>jensjungersen.dk</title>';
$rssfeed .= '<link>
http://www.yourdomain.com</link>'; $rssfeed .= '<description>RSS feed</description>';
$rssfeed .= '<language>en-us</language>';
$rssfeed .= '<copyright>Copyright (C) 2009 yourdomain.com</copyright>';
$connection = @mysql_connect(DB_HOST, DB_USER, DB_PASSWORD)
or die('Could not connect to database');
mysql_select_db(DB_NAME)
or die ('Could not select database');
$query = "SELECT * FROM database ORDER BY id DESC";
$result = mysql_query($query) or die ("Could not execute query");
while($row = mysql_fetch_array($result)) {
extract($row);
$rssfeed .= '<item>';
$rssfeed .= '<title>' . $title . '</title>';
$rssfeed .= '<description>' . $description . '</description>';
$rssfeed .= '<link>' . $link . '</link>';
$rssfeed .= '<pubDate>' . date("D, d M Y H:i:s", strtotime($date)) . '</pubDate>';
$rssfeed .= '</item>';
}
$rssfeed .= '</channel>';
$rssfeed .= '</rss>';
echo $rssfeed;
?>