RTS Posted November 3, 2006 Share Posted November 3, 2006 I am trying to make a live bookmark that retrieves the latest blog entries in my mysql database. my question is, how do I do it? this is my code right now [code]<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"> <channel> <title>Test Blog</title> <description>The most recent gossip in a live bookmark!</description> <link>http://www.test.com/</link> <docs>http://blogs.law.harvard.edu/tech/rss</docs> <lastBuildDate>Thu, 02 Nov 2006 19:54:18 -0800</lastBuildDate> <pubDate>Thu, 02 Nov 2006 19:53:55 -0800</pubDate> <generator>FeedForAll Mac v2.0 (2.0.0.4) unlicensed version; http://www.FeedForAll.com/</generator> <item> <title><?php $con = mysql_connect("localhost","ZackBabtkis","");$user = $_SESSION['username'];if(!$con) {die("could not connect");}mysql_select_db("test",$con)or die("could not connect to database");$query = mysql_query("SELECT text FROM blogn WHERE id=1");while ($row = mysql_fetch_array ($query));echo $row['text'];?></title> <link>http://www.test.com/events.php?id=1</link> <pubDate>Thu, 02 Nov 2006 19:51:34 -0800</pubDate> </item> </channel></rss>[/code] Link to comment https://forums.phpfreaks.com/topic/26020-embed-php-in-xml-file/ Share on other sites More sharing options...
Daniel0 Posted November 3, 2006 Share Posted November 3, 2006 The tutorial [url=http://www.phpfreaks.com/tutorials/139/0.php]Creating dynamic RSS feeds[/url] should give you an idea of how to do it. Link to comment https://forums.phpfreaks.com/topic/26020-embed-php-in-xml-file/#findComment-118979 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.