custom rss feed suddenly does not work anymore
Posted
by krike
on Stack Overflow
See other posts from Stack Overflow
or by krike
Published on 2010-04-19T06:23:23Z
Indexed on
2010/04/19
6:33 UTC
Read the original article
Hit count: 252
I just don't understand what's happening, I haven't change anything to the site for a few months but now suddenly the rss feed doesn't work anymore.
I create a php file with the following code:
header('Content-type: text/xml');
include("config/config.inc.php");
$result = mysqli_query($link, "SELECT * FROM tutorials ORDER BY tutorial_id DESC LIMIT 50");
?>
<rss version="2.0">
<channel>
<title>CMS tutorial site</title>
<description>Bringing you the best CMS tutorials from the web</description>
<link>http://cmstutorials.org</link>
<?php
while($row = mysqli_fetch_object($result))
{
$user = mysqli_fetch_object(mysqli_query($link, "SELECT * FROM user_extra WHERE userid=".$row->user_id.""));
?>
<item>
<title><?php echo $row->title; ?></title>
<author><?php echo $user->username; ?></author>
<description><?php echo $row->description; ?></description>
<pubDate><?php echo $row->date; ?></pubDate>
<link>http://cmstutorials.org/view_tutorial.php?tutorial_id=<?php echo $row->tutorial_id; ?></link>
</item>
<?php
}
?>
</channel>
</rss>
I checked the query by executing it in phpmyadmin and it works, doesn't give any error. When I delete the header content type and the rss tag it will print out each line from the query but the feed won't display anything
this is the link of the feed http://cmstutorials.org/rss (or http://cmstutorials.org/rss.php)
© Stack Overflow or respective owner