tags:

views:

133

answers:

1

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

A: 

I found the problem, it was the dot in $feeds[$i] .= $feed_r->feed; that I had to remove

krike