调用成员函数选择

I'm just trying to create a simple library of functions with my database autoloaded already and I'm getting this: 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 22

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

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;      
    }

}
} 

?>

Maybe it is because $this->db is not initialized, or simply because it has not been defined at the time of you invoking get_login_type();