Welcome Guest, Not a member yet? Register   Sign In
try help me with this error
#1

[eluser]ejanmapet[/eluser]
i have try 2 follow login form tutorial..but i've got this error

Fatal error: Class 'Base_Model' not found in C:\wamp\www\try\system\application\models\Users_model.php on line 3

and this is the code i'm using in model

this is user_model file

<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Users_model extends Base_Model
{
function Users_model()
{
parent::Base_model('users');
}
}
?>

this is base_model file

class Base_model extends Model //required by all models
{
var $table, $resultset, $select;

function Base_model($table = NULL)
{
parent::Model();
$this->table = $table;
$this->resultset = array();
$this->select = '*';

log_message('debug', "Base_model initialised as {$this->table}");
}

can i get some idea y i got this bug..really appreciate...thanks..
#2

[eluser]louis w[/eluser]
Is Base_model in another file? If so, you need to include it before you declare your Users_model class in Users_model.php

I am just guessing at your file structure, but this might work.
Code:
require_once('Base_model.php');
#3

[eluser]ejanmapet[/eluser]
base_model & users_model in the same model folder. i've try but still got error
#4

[eluser]louis w[/eluser]
Is the require statement before you declare the class? Did I have the file name right?
#5

[eluser]welzie[/eluser]
You are extending Base_Model, but the defined class name is Base_model
#6

[eluser]louis w[/eluser]
[quote author="welzie" date="1207951982"]You are extending Base_Model, but the defined class name is Base_model[/quote]

Good catch.
#7

[eluser]welzie[/eluser]
Are there any PHP editors which will bring an error like that to the users attention?

I use PDT and it doesn't do that or I don't know how to make it do that.




Theme © iAndrew 2016 - Forum software by © MyBB