|
Posted by Nullcode on 05/16/05 02:01
This is doing my fucking head in, what am I doing wrong, this outputs
NOTHING:
index.php has
<link rel="alternate" type="application/rss+xml" href="rss.php"
title="News RSS" />
Then I want to generate my rss feed on th fly:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>Site News</title>
<link>http://www.domain.com</link>
<description>News Headlines</description>
<?php
include("includes/dbdata.php");
$connect = mysql_connect($db_host,$db_user,$db_pass) or die(mysql_error());
$select = mysql_select_db($db_name,$connect) or die(mysql_error());
$query = "SELECT * FROM news ORDER BY id DESC LIMIT 0,10";
$result = mysql_query($query,$connect);
while($news = mysql_fetch_array($result)) {
echo "<item>\n";
echo "<title>" .$news['title'] ."</title>\n";
echo "<link>http://www.link.com</link>\n";
echo "<description>" .$news['news'] ."</description>\n";
echo "</item>\n\n";
}
?>
</channel>
</rss>
Any ideas, help, links whatever, would be very welcome.
--
Nullcode
"Suffering is a result of desire"
bnVsbGNvZGVAbnVsbGNvZGUuY29t
www.hidemyemail.net
Navigation:
[Reply to this message]
|