Welcome Guest, Not a member yet? Register   Sign In
Call to member function select
#1

[eluser]xtremer360[/eluser]
I'm just trying to create a simple library of functions for my CMS. I currently have my database autoloaded. When I try and load my login controller I get this error message:

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Kow_auth::$db

Filename: libraries/Kow_auth.php

Line Number: 20

Fatal error: Call to a member function select() on a non-object in /home/xtremer/public_html/kowmanager/application/libraries/Kow_auth.php on line 20

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

/**
* KOW Auth Library
* Authentication Library for Code Igniter
* @author Jeffrey Davidson
* @version 1.0.0
* @copyright 2012
*/

class Kow_auth
{
    function _construct()
    {
        parent::__construct();
    }
    
    function get_login_type()
    {
        $this->db->select('login_types.login_type');
        $this->db->from('settings');
        $this->db->join('login_types', 'login_types.id = settings.login_types_id');
        $query = $this->db->get();
        if ($query->num_rows() > 0)
        {
            $row = $query->row();
            return $row->login_type;
        }
        else
        {
            return false;      
        }

    }
}

?>




Theme © iAndrew 2016 - Forum software by © MyBB