need help setting a php variable
Posted: Mon Jun 06, 2011 9:15 pm
this will be probably be an easy question for some of you, but i am having a problem assigning a string to a php variable. i have several rss feeds stored in a database. the stored info includes the rss feed name, link to the actual site, link for just the rss for the site, etc...
i am running a do/while loop to output the rss feeds. the output is simply the title of the site and the 8 most recent articles from the site. everything is outputting fine, in terms of the actual display and the title of the rss feeds showing up, but i can't plug in the rss feed link without getting an error. this is the code i am using (there is a bit more to the code, but this is the only place the problem is showing up):
<?php include('RSS/rss_fetch.inc');
$rss = fetch_rss('rss feed link goes here');
// array shows first 8 results
$items = array_slice($rss->items, 0,
;
// Cycle through each item and echo
foreach ($items as $item )
{ ?>
the bolded line is the only place i'm running into a problem. i have the correct rss feed link stored in the database. i would reference it in my code as
<?php echo $row_resourceFeed_rs['rssLink']; ?>
however, if i replace the current rss link (the one bolded above) with the php call to the database for the correct link, i get an error. can somebody please tell me how to pull the rss feed link into that bolded line?
i am running a do/while loop to output the rss feeds. the output is simply the title of the site and the 8 most recent articles from the site. everything is outputting fine, in terms of the actual display and the title of the rss feeds showing up, but i can't plug in the rss feed link without getting an error. this is the code i am using (there is a bit more to the code, but this is the only place the problem is showing up):
<?php include('RSS/rss_fetch.inc');
$rss = fetch_rss('rss feed link goes here');
// array shows first 8 results
$items = array_slice($rss->items, 0,
// Cycle through each item and echo
foreach ($items as $item )
{ ?>
the bolded line is the only place i'm running into a problem. i have the correct rss feed link stored in the database. i would reference it in my code as
<?php echo $row_resourceFeed_rs['rssLink']; ?>
however, if i replace the current rss link (the one bolded above) with the php call to the database for the correct link, i get an error. can somebody please tell me how to pull the rss feed link into that bolded line?