Welcome Guest, Not a member yet? Register   Sign In
noob here: stupid error message
#1

[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
#2

[eluser]Michael Wales[/eluser]
Make sure you are loading the database class, either view autoload.php or via the load class within your controller.
#3

[eluser]tucspl[/eluser]
Ok here is my 'core' section on autoload.php:

Code:
<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');


$autoload['libraries'] = array();


$autoload['core'] = array('database');



/*

| -------------------------------------------------------------------

|  Auto-load Helper Files

| -------------------------------------------------------------------

| Prototype:

|

I am also trying to follow the video tutorial on the main site.
#4

[eluser]Michael Wales[/eluser]
The database class is a library. Change your code to:

Code:
$autoload['libraries'] = array('database');
$autoload['core'] = array();

Refer to documentation.
#5

[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:

application/config/autoload.php

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:

application/config/autoload.php
#6

[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
#7

[eluser]Michael Wales[/eluser]
Scafffolding User Guide
Scaffolding has nothing to do with autoload.
#8

[eluser]tucspl[/eluser]
how would I display the entries database table with my entries in it on the view page like the tutorial does?
#9

[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.
#10

[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?




Theme © iAndrew 2016 - Forum software by © MyBB