CodeIgniter Forums
try help me with this error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: try help me with this error (/showthread.php?tid=7477)



try help me with this error - El Forum - 04-10-2008

[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..


try help me with this error - El Forum - 04-10-2008

[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');



try help me with this error - El Forum - 04-10-2008

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


try help me with this error - El Forum - 04-11-2008

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


try help me with this error - El Forum - 04-11-2008

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


try help me with this error - El Forum - 04-11-2008

[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.


try help me with this error - El Forum - 04-11-2008

[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.