toxictoad Posted December 2, 2008 Share Posted December 2, 2008 Hey all, I followed a tutorial a while back and put together a php page for an RSS Feed and although it works as it is, I want it to pull more info fromt the database but I've tried all the obvious (to me) things and it's not working so can anyone help? This is the working code <?php header("Content-type: text/xml"); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> "; // Set RSS version. echo " <rss version=\"2.0\"> "; // Start the XML. echo " <channel> <title>News From Around The World</title> <description>News and Information from all over the web brought to you by phatjoints.com</description> <link>http://www.phatjoints.com/</link>"; // Create a connection to your database. require("config.php"); // Query database and select the last 10 entries. $data = mysql_query("SELECT * FROM rssfeeds ORDER BY NewsID DESC LIMIT 10"); while($row = mysql_fetch_array($data)) { // Continue with the 10 items to be included in the <item> section of the XML. echo " <item> <link>http://www.phatjoints.com/newsfeeds/details.php?id=".$row[NewsID]."</link> <guid isPermaLink=\"true\">http://www.phatjoints.com/newsfeeds/details.php?id=".$row[NewsID]."</guid> <title>".$row[Title]."</title> <description><![CDATA[".$row[Content]."]]></description> </item>"; } echo " </channel> </rss>"; ?> If I change the <description> tags to <content></content> the info doesn't show so I guess that the naming needs to be just right but I don't know what 'right' is... I tried adding a line <source><![CDATA[".$row[source]."]]></source> but that doesn't work either. The thing is, it's also XML in the PHP so not even sure if this forum will be the right place to post but here I am Hope you can help Here's the feed link: http://www.phatjoints.com/newsfeeds/rsstestfeed.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.