Model error |
[eluser]barak[/eluser]
Hi, I have a problem loading a model. This is how its start: Code: function show() The error is on the query line. This is the error: Code: Fatal error: Call to a member function query() on a non-object in C:\wamp\www\arena\system\application\models\s_train.php on line 12 Last time I had this error because I forget to parent the function. But now I do have this line. Thank you.
[eluser]umefarooq[/eluser]
hi are you calling database library if not you can load it in you controller or either in config/autoload file, Code: $this->load->library('database');
[eluser]Dam1an[/eluser]
Actually, you don't load the database library like other libraries, see user guide for more info
[eluser]TheFuzzy0ne[/eluser]
It should be $this->load->database(), but I think it goes through the library loader anyway, so that should work.
[eluser]Dam1an[/eluser]
[quote author="TheFuzzy0ne" date="1243191583"]It should be $this->load->database, but I think it goes through the library loader anyway, so that should work.[/quote] I knoq the db is autoloaded with the rest of the libraries, but I remember someone having a prpoblem trying to load it manually via the normal librray loader (also, its good for them to reads the docs ![]() |
Welcome Guest, Not a member yet? Register Sign In |