[eluser]LifeSteala[/eluser]
Your model is not right still. You should not do any data manipulation in a model. Instead, a model should be used to put and get data to and from your database. It should be:
Code:
<?php
class tags extends Model{
var $title;
var $description;
var $link;
function tags()
{
parent::Model();
$this->load->database('default');
}
function showAll()
{
$fetch_all = $this->db->query("SELECT * FROM `tags`");
if ( $fetch_all ) {
return $fetch_all;
}
return false;
}
}
Then in your controller catch whatever returns from showAll, and pass it through to the view via an Array.
Controller:
Code:
class Test extends Controller {
function Test() {
parent::Controller();
// Load stuff here
$this->load->model('tags');
}
function method() {
$data['showall'] = $this->tags->showAll();
$this->load->view('viewname', $data);
}
}
In your view, access $showall and use the foreach statement above.