CodeIgnitor problem

I was learning a tutorial and i found this problem but not understanding wht is ths?
Fatal error: Cannot redeclare class Users in D:\xampp\htdocs\projects\Clients\CodeIgnitor\CodeIgniter_1.7.1\system\application\models\Users.php on line 80
The code is here
for model class
class Users extends Model{

function Users(){

// call the Model constructor


// load database class and connect to MySQL



function getAllUsers(){



// return result set as an associative array

return $query->result_array();



function getUsersWhere($field,$param){



// return result set as an associative array

return $query->result_array();


// get total number of users

function getNumUsers(){

return $this->db->count_all('users');



for controller class
class Users extends Controller{

function Users (){

// load controller parent


// load 'Users' model



function index(){

// store data for being displayed on view file



$data['title']='Displaying user data';

$data['header']='User List';

// load 'users_view' view



please tell me wht actually is and i don't get the logic behind this.

[eluser]GSV Sleeper Service[/eluser]
you can't have two classes with the same name (unless you use namespaces, which is never going to happen with CI)
rename your Users model to something like Users_model and all should be fine

In CI, is it neccessary to associate the name of the file with the class you are developing?
if yes then i changed the names of the files but the code didn't work?

Please read user guide before u get started..all ans you will find there.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.