[eluser]Lockzi[/eluser]
I'm trying to store some RSS feeds into a database of mine for fun...
Now I'm having a huge-a problem with $descr for some reason...
Code:
foreach ($this->simplepie->get_items() as $item) {
$href = $item->get_link();
$title = $item->get_title();
$descr = $item->get_description();
if($this->rss_model->checkNewFeed($href))
{
die(var_dump($descr));
$this->rss_model->insertNewFeed($feedName, $title, $href, $descr);
}
}
That code produces the following:
string(0) ""
Sure... That make's it look like there's no description... But watch this!
Code:
foreach ($this->simplepie->get_items() as $item) {
$href = $item->get_link();
$title = $item->get_title();
$descr = $item->get_description();
die(var_dump($descr));
if($this->rss_model->checkNewFeed($href))
{
$this->rss_model->insertNewFeed($feedName, $title, $href, $descr);
}
}
That code dumps this...
string(159) "The title of that feed item bla bla bla"
and I've checked this quite alot, and my conclusion is that whenever I use $this-> somewhere (*edit* between setting it and reading it *edit*) it looses the information in $descr.
Is that a bug?
Is there a way to get around it since I'd like to keep the checkNewFeed() code in the model to keep the database connections in the same place?
Regards,
Christoffer Wallenius