Welcome Guest, Not a member yet? Register   Sign In
database.php config not being loaded
#1

[eluser]Unknown[/eluser]
Hi, I keep getting the following error
Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Auth::$DB

Filename: models/auth.php

Line Number: 8

Fatal error: Call to a member function get_where() on a non-object in /home/simon/public_html/web/astronomy/system/application/models/auth.php on line 8

I have read several posts and all seem to point to not loading the database library.

I have however got the following line in my autoload.php file
Code:
$autoload['libraries'] = array('database');

The following is the content of my database.php file
Code:
$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "simon_simon";
$db['default']['password'] = "***********";
$db['default']['database'] = "simon_SiteDB";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

I have loaded the model in my controller with
Below is the code from my model, which is generating the undefined property error
Code:
<?php

class Auth extends Model{
    
    
    function DoLogin($Email,$Password){
        
        $query = $this->db->get_where('user',array('email=>'&$Email & ',password=>'&$Password));
        
        if ($query->result){
            return true;
            }
            else
            {
            return false;
        }
        
    }
    
    
    function Register($UserDetails){
        
    }
}

The reason I think the database.php file is not being loaded is that I have deliberately added errors to the database.php file and do not get any error message.

Can someone help in where I may be going wrong. I have been pulling my hair out for about 5 hours.

Thanks
Simon


Messages In This Thread
database.php config not being loaded - by El Forum - 04-02-2010, 12:50 PM
database.php config not being loaded - by El Forum - 04-02-2010, 03:09 PM
database.php config not being loaded - by El Forum - 04-07-2010, 09:40 AM
database.php config not being loaded - by El Forum - 04-07-2010, 10:00 AM
database.php config not being loaded - by El Forum - 04-07-2010, 10:13 AM
database.php config not being loaded - by El Forum - 04-07-2010, 10:29 AM
database.php config not being loaded - by El Forum - 04-07-2010, 10:42 AM
database.php config not being loaded - by El Forum - 04-07-2010, 10:55 AM
database.php config not being loaded - by El Forum - 04-07-2010, 06:09 PM
database.php config not being loaded - by El Forum - 04-08-2010, 01:16 AM
database.php config not being loaded - by El Forum - 07-15-2010, 10:16 AM
database.php config not being loaded - by El Forum - 07-15-2010, 11:59 AM
database.php config not being loaded - by El Forum - 07-15-2010, 12:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB