Page 1 of 1

using a feed as a variable

Posted: 2010-11-26 19:16
by ianraba
Hi
On my test site: http://www.jobs4salons.co.uk/rss/rss_list.php
am pulling all my relvant feeds together and linking from that page to this:
http://www.jobs4salons.co.uk/rss/rss.php?id=2
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

Re: using a feed as a variable

Posted: 2010-11-28 10:43
by Fred
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 http://www.something.com/index.xml

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 = 'http://www.avweb.com/avwebbiz/index.xml';

$MXRSS_Recordset1 = new MX_RssReader();
$MXRSS_Recordset1->setConnection($database_fosterDb, $fosterDb);
$MXRSS_Recordset1->setCacheTime(60);		
$MXRSS_Recordset1->getFeed($news);