I have a problem. Is any possibility to put my xml file into a database and access them from it. I have this function that get content from a xml file:
function getFeed()
{
$content = file_get_contents('http://feeds.reuters.com/reuters/technologyNews');
$x = new SimpleXmlElement($content);
foreach($x->channel->item as $entry) {
$feeds = array('title' => (string)$entry->title
);
$this->session->set_userdata($feeds);
$this->load->model('membership_model');
$this->membership_model->feeds();
}
And a model who insert the titles into a database and after this get the titles as a link format. But i guess is not a good idea because is not working.
function feeds()
{
$this->db->empty_table('feeds');
$this->db->set('title',$this->session->userdata('title'));
$this->db->insert('feeds');
$get_feed = $this->db->get('feeds');
foreach ($get_feed->result() as $row){
echo "<a href='$row->title'>".$row->title."</a><br/>";
}