homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
Forum Library, Charter, Moderators: bill & werty

RSS, ATOM, and Related Technologies Forum

rss output problem while parsing with megpie
parsing rss feed mysql php

5+ Year Member

Msg#: 3504110 posted 9:13 pm on Nov 13, 2007 (gmt 0)

hi guys im trying to build dynamic rss feed from our data base, then use megpie to parse them. im not sure where is the problem on my code, im getting this error while parsing the feed :

Warning: MagpieRSS: Failed to parse RSS file. (xml declaration not at start of external entity at line 1, column 1) in /home/example/public_html/testserv/rssdemo/magpierss/rss_fetch.inc on line 238
Problem with: <snip>

any help will be really appreciated. here is the code to get the data out of mysql and get the clea xml.

$dbconnect = mysql_pconnect(localhost,$username,$password);
mysql_select_db($database, $dbconnect);
$query = "SELECT id, title, itemcomment, picturelink FROM jos_seyret_items WHERE featured='1' order by id desc limit 15";
$result = mysql_query($query, $dbconnect);
while ($line = mysql_fetch_assoc($result))
$return[] = $line;
$now = date("D, d M Y H:i:s T");
$output = "<?xml version=\"1.0\"?>
<rss version=\"2.0\">
<title>What's hot</title>
<description>Latest Video on example.com</description>
foreach ($return as $line)
$output .= "<item><title>".htmlentities($line['title'])."</title>
$output .= "</channel></rss>";
header("Content-Type: application/rss+xml");
echo $output;

[edited by: bill at 1:07 am (utc) on Nov. 14, 2007]
[edit reason] No links to examples or URLs in your code please [/edit]



WebmasterWorld Senior Member penders us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

Msg#: 3504110 posted 3:43 pm on Nov 26, 2007 (gmt 0)

Just curious as to whether you managed to solve your problem? If so, was it an issue with MagpieRSS, or your RSS feed itself?


5+ Year Member

Msg#: 3504110 posted 11:06 pm on Nov 27, 2007 (gmt 0)

I coudnt get it to work with megpie for some reason, so i changed the pvp script to get the my feed clean and then validated it. works pretty good now.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved