[eluser]jtotheb[/eluser]
The Model:
Code:
<?php
class Testmodel extends Model {
function Testmodel()
{
parent::Model();
}
function get_page_title()
{
$query = $this->db->query('SELECT page_info.page_title FROM page_info');
$row = $query->row();
}
}
?>
The Controller:
Code:
<?php
class Test_con extends Controller {
function Test_con()
{
parent::Controller();
}
function index()
{
$this->load->model('Testmodel');
$data['page_title'] = $this->Testmodel->get_page_title();
$this->load->view('selection', $data);
}
}
?>
The View:
Code:
<?php echo $page_title;?>
It just returns nothing in the view. If i change it in the view to <?php echo $data;?> it returns the word "array".
What am i doing wrong here?!
The database is two columns - id, page_title and one row of data - 1, "i'm the title"
If i do a print_r ($data) i can see the page title but it is in another array within an array or something!
Any help would be great. Thank you.