![]() |
noob here: stupid error message - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: noob here: stupid error message (/showthread.php?tid=3113) |
noob here: stupid error message - El Forum - 09-10-2007 [eluser]tucspl[/eluser] error message keeps on coming up, I can't see how to fix it. Fatal error: Call to a member function get() on a non-object in /home/chainrea/public_html/dev/infrastructure/application/controllers/site.php on line 16 noob here: stupid error message - El Forum - 09-10-2007 [eluser]Michael Wales[/eluser] Make sure you are loading the database class, either view autoload.php or via the load class within your controller. noob here: stupid error message - El Forum - 09-10-2007 [eluser]tucspl[/eluser] Ok here is my 'core' section on autoload.php: Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); I am also trying to follow the video tutorial on the main site. noob here: stupid error message - El Forum - 09-10-2007 [eluser]Michael Wales[/eluser] The database class is a library. Change your code to: Code: $autoload['libraries'] = array('database'); Refer to documentation. noob here: stupid error message - El Forum - 09-10-2007 [eluser]Michael Wales[/eluser] Wow - I think you just spotted an error in the documentation, now that I look back over it (I always just referred to the comments within autoload.php). The documentation reads: Quote:The "auto connect" feature will load and instantiate the database class with every page load. To enable "auto connecting", add the word database to the core array, as indicated in the following file: It should read: Quote:The "auto connect" feature will load and instantiate the database class with every page load. To enable "auto connecting", add the word database to the libraries array, as indicated in the following file: noob here: stupid error message - El Forum - 09-11-2007 [eluser]tucspl[/eluser] So, now if I want to load the query of my scaffolding results on my view page, what code to I put on the controller and the view since it is no longer 'autoload['core']' again, I am a noob. thanks in advance noob here: stupid error message - El Forum - 09-11-2007 [eluser]Michael Wales[/eluser] Scafffolding User Guide Scaffolding has nothing to do with autoload. noob here: stupid error message - El Forum - 09-11-2007 [eluser]tucspl[/eluser] how would I display the entries database table with my entries in it on the view page like the tutorial does? noob here: stupid error message - El Forum - 09-11-2007 [eluser]Michael Wales[/eluser] Using Scaffolding? Simply make a Controller, drop the Scaffolding code in there, then visit the URL with your Scaffolding trigger. Code: $this->load->scaffolding('table_name'); Read the documentation. noob here: stupid error message - El Forum - 09-11-2007 [eluser]tucspl[/eluser] ok, i am displaying the entries on my page now, how would I go about making these descending, the newest entries appear first? |