Welcome Guest, Not a member yet? Register   Sign In
loading model result error
#1

[eluser]roothacker[/eluser]
hi i m new to codeigniter and I just start playing it i have downloaded version 2.0 and only set config.php,database.php,autoload.php for database settings and loading database library.
Then I have created a controller name site.php and then created a model "site_model.php"
inside this file declare a class as follows
Code:
<php
class Site_model extends CI_Model {

    function __construct()
    {
        parent::__construct();
    }
    function GetAll()
    {
        $query = $this->db->get('test', 10);
        return $query->result();
    }
}

?&gt;


now inside my controller "site.php" I have following code
Code:
&lt;?php
class site extends CI_Controller
{
    function index()
    {
        $this->load->model('Site_model');
        $this->load->view('home');
    }
    function about()
    {
        $this->load->view('about');
    }
}

Now as i open site in browser giving me following error

Code:
db->get('test', 10); return $query->result(); } } ?&gt;
( ! ) Fatal error: Class 'Site_model' not found in D:\wamp\www\ci\system\core\Loader.php on line 198
Call Stack
#    Time    Memory    Function    Location
1    0.0008    688848    {main}( )    ..\index.php:0
2    0.0025    760392    require_once( 'D:\wamp\www\ci\system\core\CodeIgniter.php' )    ..\index.php:163
3    0.0415    3317328    call_user_func_array ( )    ..\CodeIgniter.php:297
4    0.0415    3317408    site->index( )    ..\CodeIgniter.php:0
5    0.0415    3317536    CI_Loader->model( )    ..\site.php:6


Messages In This Thread
loading model result error - by El Forum - 02-19-2011, 04:09 AM
loading model result error - by El Forum - 02-19-2011, 04:30 AM
loading model result error - by El Forum - 02-19-2011, 05:22 AM
loading model result error - by El Forum - 02-19-2011, 05:25 AM
loading model result error - by El Forum - 02-19-2011, 05:29 AM
loading model result error - by El Forum - 02-19-2011, 05:36 AM
loading model result error - by El Forum - 02-19-2011, 05:40 AM
loading model result error - by El Forum - 02-19-2011, 05:50 AM
loading model result error - by El Forum - 02-19-2011, 05:50 AM
loading model result error - by El Forum - 02-19-2011, 05:53 AM
loading model result error - by El Forum - 02-19-2011, 05:59 AM
loading model result error - by El Forum - 02-19-2011, 06:04 AM
loading model result error - by El Forum - 02-19-2011, 06:06 AM
loading model result error - by El Forum - 02-19-2011, 06:10 AM
loading model result error - by El Forum - 02-19-2011, 06:13 AM
loading model result error - by El Forum - 02-19-2011, 06:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB