Jump to content

help with RSS feed file, php/mysql site


dvdflashbacks

Recommended Posts

I have an RSS feed file on my site that was previously working but suddenly has stopped.  My hosting company has checked everything on there end and they have told me that it has to be my file (though this file works on another server just fine as well as my test server using MAMP.)  They also claimed that when they navigated to the feed.php file it randomly would work.

 

Can someone please take a look at this file and help me figure out what I need to do to get this working again?  I am getting desperate.

 

<?php
  /**
   * Use FULL php tags, not the short <? as some PHP
   * installs may not be configured to use them
   * 
   * In the header() function, it had MSWord style quotes
   * around it. I changed them to normal quotes
   * Requires should come at the beginning
   */
  require_once('Connections/conndb.php');
?>
<rss version="0.92">
<channel>
<title>The Health Journals News Feed</title>
<link>http://www.thehealthjournals.com</link>
<description>The Health Journals RSS Feed</description>
<language>en-us</language>
<?php
  mysql_select_db($database_conndb, $conndb) or die(mysql_error());
  $sql = "SELECT blog_item_id, blog_item_datetime, blog_item_title, Left(blog_item, 250) as blog_item FROM blog_items ORDER BY blog_item_datetime DESC";
  $result = mysql_query($sql, $conndb) or die(mysql_error());

  /**
   * The WHILE loop was missing here...i added it back
   */
  while($row = mysql_fetch_array($result)){
?>
<item>
  <title><?php htmlspecialchars(strip_tags($result['blog_item_title'])); ?></title>
  <description><?php htmlspecialchars(strip_tags($result['blog_item'])); ?></description>
  <link>http://www.thehealthjournals.com/archive.php?id=<?=$row['blog_item_id']; ?></link>
  <guid>http://www.thehealthjournals.com/archive.php?id=<?=$row['blog_item_id']; ?></guid>
  <pubDate><?php htmlspecialchars(strip_tags($result['blog_item_datetime'])); ?></pubDate>
</item>

<?php
}
?>
</channel>
</rss>

Link to comment
https://forums.phpfreaks.com/topic/139744-help-with-rss-feed-file-phpmysql-site/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.