I am trying to produce an array of values to be used by a variable, but I can't get it to work. I don't want to "see" the results. Instead, I want the variable to "use" the results. Here's my code:
$rss_results = mysql_query("SELECT feed_id, feed_url, feed_title, feed_order, feed_page_id FROM user_feeds WHERE ((feed_owner = '" . $_SESSION['UserId'] . "'));");
if ($rss_results) {
while($row = mysql_fetch_array($rss_results))
{
$feed->set_feed_url(print "'".$row[feed_url]."',");
}
}
else {
// something went wrong.
echo mysql_error();
The problem is with the line:
$feed->set_feed_url(print "'".$row[feed_url]."',");
EDIT 1) Yes. I know print doesn't belong there. I forgot to remove it after doing some troubleshooting earlier.
2) I am trying to use this code with an RSS parser calleld SimplePie.
3) Everyone seems to agree that the following code works
$feed->set_feed_url(array("'" . $row['feed_url'] . "',"));
...but it doesn't. If I weren't accessing my db, the code would look something like this....
$feed->set_feed_url(array('http://www.tmz.com/rss.xml', 'feed://rss.cbc.ca/lineup/topstories.xml'));
...which works just fine. I am trying to reproduce that effect using values stored in a mysql db. If the code worked, it would be working. So there must be a problem with the code that is "supposed" to be working.