Fatal error: Call to a member function query() on a non-object |
[eluser]Creox[/eluser]
[quote author="John_Betong_002" date="1308254970"]Have you tried using another table name? Also try http://localhost/phpmyadmin/index.php and check your database and tables. [/quote] John, The tbales are in the database that i connect to succesffully. When I exectue the following code Code: $query = $this->db->query('SELECT * FROM users WHERE UserID = '.$userID.' LIMIT 1'); I expect to get a result back. However I get the following Quote:A PHP Error was encountered i have autoloaded the database in config/autoload.php Code: $autoload['libraries'] = array('database'); What else could it be? This is driving me insane. I have just downloaded CI v2.01 at the error still occurs. Please help. Thanks Ciaran
[eluser]John_Betong_002[/eluser]
It looks as though your database class is not getting loaded. Try setting your ./application/config/config.php and make sure everything is getting loaded. Code: $config['log_threshold'] = '4'; Also try this: Code: error_reporting(-1);
[eluser]Creox[/eluser]
Sorry John, That didnt work. The ouput is now Code: A PHP Error was encountered
[eluser]John_Betong_002[/eluser]
Did you check your error log? If there are no errors to be fixed in your error log then I would try copying the example from "Creating your own Models" and change the values where required. http://ellislab.com/codeigniter/user-gui...odels.html Code: <?php
[eluser]InsiteFX[/eluser]
Show your code were your loading your model! InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |