[eluser]coding[/eluser]
hi all . this is my first post. I'm a student and want to learn php and codeigniter. i downloaded the tutorial videos i'm trying to build a weblog watching the tutorial video but i'm getting an error. may be simple but can't figure out so please help me figure it out.
first of all here is the error..........
------------------------------------------------------------------------------
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Home::$db
Filename: controllers/home.php
Line Number: 12
Fatal error: Call to a member function get() on a non-object in D:\Program Files\xampp\htdocs\CI\system\application\controllers\home.php on line 12
-----------------------------------------------------------------------------
now here is home.php
-----------------------------------------------------------------------------
<?php
class Home extends Controller {
function Home()
{
parent::Controller();
}
function index()
{
$data['query']= $this->db->get('movies');
$this->load->view('home_page',$data);
}
}
?>
---------------------------------------------------------------------------------
and home_view.php
----------------------------------------------------------------------------------
<html>
<head>
<title>
</title>
</head>
<body>
ok this is the page.
<?php foreach($query->result() as row): ?>
<?php $row->id ?>
<php? endforeach; ?>
</body>
</html>
------------------------------------------------------------------------------------
i've configured database correctly. config->database file.
please help me learn this framework thing.