Welcome Guest, Not a member yet? Register   Sign In
hooks + database(not able to access database)
#2

[eluser]ejangi[/eluser]
You probably need to load the database stuff explicitly as the DB stuff normally gets loaded during the Controller (whereas you're doing this hook pre-controller):
Code:
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
class getSystem
{
    var $CI;
    function check()
    {
       define('MAIL',TRUE); //this is running
       $this->CI =& get_instance(); got instance of CI
       $this->CI->load->database();
       //$query = $this->CI->db->get('laf_admin'); //if uncommented, gives error

    }
}
?>


Messages In This Thread
hooks + database(not able to access database) - by El Forum - 01-15-2008, 11:22 PM
hooks + database(not able to access database) - by El Forum - 01-16-2008, 12:08 AM
hooks + database(not able to access database) - by El Forum - 01-16-2008, 12:19 AM
hooks + database(not able to access database) - by El Forum - 01-16-2008, 12:28 AM
hooks + database(not able to access database) - by El Forum - 01-16-2008, 04:04 AM
hooks + database(not able to access database) - by El Forum - 01-16-2008, 05:59 AM
hooks + database(not able to access database) - by El Forum - 01-16-2008, 09:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB