I'm trying to build a simple RSS feed for multiple users but i am facing problems with mysql and the feed.
Ive done a showrss.php and an RSS.php I have followed a tutorial on this, and it works as should out of the box. But, im trying to build it, using var's on the mysql query populating the RSS.
so the showrss.php will do this :
require_once "XML/RSS.php";
$rss =& new XML_RSS("http://domain.com/RSS.php");
$rss->parse();
foreach ($rss->getItems() as $item) {
echo "<li><a href=\"" . $item['link'] . "\">" . $item['title'] .
"</a></li>
";
}
Calling up the RSS.php file. The only thing wrong with the RSS.php is the mysql query. IT simply wont work with variables in the query, and im wondering if any of you guys could point me in the right direction.
This works :
$query = "select * from article where full_name = 'myname' limit 15";
this does'nt work :
$full_navn = $_SESSION['full_name'];
$query = "select * from article where full_name = '".$full_navn."' limit 15";
However, loading the RSS.php straight in the browser with the variable does work. Any ideas on how to get my variable into rss.php when viewing it through showrss.php ?
Greatly appreciate any input.