Simplepie - fetch feeds from database
Posted
by krike
on Stack Overflow
See other posts from Stack Overflow
or by krike
Published on 2010-01-11T17:30:57Z
Indexed on
2010/05/03
11:18 UTC
Read the original article
Hit count: 364
I want to fetch multiple feeds from the database and in so doing fetch all new content from those feeds
it works but there is a problem and I have no idea what's causing it, this is the code:
$feed_sql = mysqli_query($link, "SELECT feed from tutorial_feed WHERE approved=1");
$feeds = array();
$i = 0;
while($feed_r = mysqli_fetch_object($feed_sql)):
$feeds[$i] .= $feed_r->feed;
$i++;
endwhile;
$feed = new SimplePie($feeds);
$feed->handle_content_type();
foreach($feed->get_items(0, 100) as $item) :
echo $item->get_permalink()."
";endforeach;
I first get
Notice: Undefined offset: 0 in I:\wamp\www\cmstut\includes\cron.php on line 22
Notice: Undefined offset: 1 in I:\wamp\www\cmstut\includes\cron.php on line 22
Notice: Undefined offset: 2 in I:\wamp\www\cmstut\includes\cron.php on line 22
Notice: Undefined offset: 3 in I:\wamp\www\cmstut\includes\cron.php on line 22
Notice: Undefined offset: 4 in I:\wamp\www\cmstut\includes\cron.php on line 22
Notice: Undefined offset: 5 in I:\wamp\www\cmstut\includes\cron.php on line 22
Notice: Undefined offset: 6 in I:\wamp\www\cmstut\includes\cron.php on line 22
Notice: Undefined offset: 7 in I:\wamp\www\cmstut\includes\cron.php on line 22
Notice: Undefined offset: 8 in I:\wamp\www\cmstut\includes\cron.php on line 22
Notice: Undefined offset: 9 in I:\wamp\www\cmstut\includes\cron.php on line 22
Notice: Undefined offset: 10 in I:\wamp\www\cmstut\includes\cron.php on line 22
and then it will start printing the permalinks to the new content based on the imported feeds, I know undefined offset means it does not exist but I don't get it, any help would be appreciated
© Stack Overflow or respective owner