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

[eluser]nirbhab[/eluser]
hello everybuddy,
i have a small problem. i am not able to access database in hook.

config.php
Code:
$config['enable_hooks'] = TRUE;

hooks.php
Code:
$hook['pre_controller'] = array(
                                'class'    => 'getSystem',
                                'function' => 'check',
                                'filename' => 'getsystem.php',
                                'filepath' => 'hooks'
                                );

getsystem.php

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
                //$query = $this->CI->db->get('laf_admin'); //if uncommented, gives error

    }
}
?>

wht to do?


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