using a feed as a variable

Posts: 34
Joined: 2010-06-24 17:44

using a feed as a variable

Post by ianraba » 2010-11-26 19:16

On my test site:
am pulling all my relvant feeds together and linking from that page to this:
am getting the error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/jobs4sal/public_html/rss/rss.php on line 51

Line51 is: $MXRSS_rss1->getFeed("$row_rss['rss_feed']");

so i have replaced the actual hardcoded url with one from my database and i know its wrong and i need to encapsulate that call but am stumped as to how to achieve it so that the output between quotation marks is what is in DB

Thanks for any advice

User avatar
Site Admin
Posts: 491
Joined: 2010-02-15 12:10
Location: Armagh, Northern Ireland

Re: using a feed as a variable

Post by Fred » 2010-11-28 10:43

Hi Ian,
Not sure if I understand you correctly.

You have a db with a list of feeds?
e.g. feed id=2 will be something like

On you list page leave it as it is.
On you rss.php?id=2 you will again query you db first to get the actual feed-url.

SELECT * from feeds WHERE id = url_paramter

I am using the MXRSS Recordset on a page where you normally hard_code the url

Just did a test "simulating" a variable feed-url

Code: Select all

$news = '';

$MXRSS_Recordset1 = new MX_RssReader();
$MXRSS_Recordset1->setConnection($database_fosterDb, $fosterDb);

Post Reply