Welcome to WebmasterWorld Guest from

Forum Moderators: bill & werty

Message Too Old, No Replies

Dynamic updation of rss with php-mysql

need help for Dynamic updation of rss with php and mysql



9:47 am on Mar 19, 2005 (gmt 0)

10+ Year Member

I m trying create rss feed which is database driven.
i have taken help of online documents. It is generating errors when seen in browser or RSS Aggregator.

databas name:testing
table: rss

The code which I m trying is:

<? header('Content-type: text/xml');?>
$con= mysql_connect('localhost','root','') or die('Unable to connect');
$db=mysql_select_db('testing') or die('unable to connect database');

<rss version="2.0">
<title>Name of your site</title>
<description>A description of your site</description>
<copyright>Your copyright information</copyright>

$getItems="SELECT id,title,body,UNIX_TIMESTAMP(datepub) AS pubDate from rss ORDER BY pubDate DESC";

$pubDate=strftime("%a, %d %b %Y %T %Z",$doGet['pubDate']);

// output to browser


<title><?php print htmlentities($title,'ENT_QUOTES');?></title>
<description><?php print htmlentities($body,'ENT_QUOTES');?></description>
<link>http://your_url/path/and_page.php?article=<?php print $id;?></link>
<pubDate><?php print $pubDate;?></pubDate>



The error generated is:

The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


End tag 'channel' does not match the start tag 'br'. Error processing resource 'http://localhost/rss/index.php'. Line 12, ...


Kindly do help me out...


12:05 am on Mar 20, 2005 (gmt 0)

10+ Year Member

Not sure if any good php jockeys visit this forum a lot. If you don't get an answer in here soon I would suggest trying the same post over in the php [webmasterworld.com] forum.

Sorry I can't be more helpful.


Featured Threads

Hot Threads This Week

Hot Threads This Month