Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Cannot redeclare class users
#1

[eluser]Unknown[/eluser]
Hi, I am new to CI , and was following the tutorial found at Devshed: Introduction-to-the-CodeIgniter-PHP-Framework - Part 2 - Databases , and I'm getting the error,
Fatal error: Cannot redeclare class Users in C:\wamp\www\CodeIgniter_1.7.2\system\application\models\users.php on line 31

What to do? I've followed the steps which are given there, I'm using Windows 7, WAMP, CI 1.7.2 , PHP 5.3.0
I've checked my code thouroughly, I'm not redeclaring that class anywhere else.
#2

[eluser]Unknown[/eluser]
Ok, I solved it myself , the controller class and model class names where the same , So I renamed one of the classes and it worked, Some one should correct that tutorial :-) :-P
#3

[eluser]cahva[/eluser]
Yeah.. Its always better to name your models with _model suffix eg. users_model. That way the class names dont clash with eachother.

Thats quite old tutorial althought the principles are correct. Nettuts+ has some more recent tutorials for CI, you might want to check them.




Theme © iAndrew 2016 - Forum software by © MyBB