Welcome Guest, Not a member yet? Register   Sign In
Cannot query database in custom_helper?
#1

[eluser]java[/eluser]
I have a function placed in custom_helper file :
Code:
function getCityName($id)
{
    $query = $this->db->getwhere('thanhpho', array('ThanhPhoID' => $id));
    $row = $query->row();
    return $row->Ten;
}
i want it automatically called in my view. But the view generated error:
Quote:Fatal error: Call to a member function on a non-object in d:\www\hoahau\system\application\helpers\custom_helper.php on line 181
and line 181 is my query command in function above.
What's the wrong in my code? Please tell.
Thanks for any response


Messages In This Thread
Cannot query database in custom_helper? - by El Forum - 06-30-2007, 02:50 AM
Cannot query database in custom_helper? - by El Forum - 06-30-2007, 08:16 AM
Cannot query database in custom_helper? - by El Forum - 07-01-2007, 07:37 PM
Cannot query database in custom_helper? - by El Forum - 07-01-2007, 09:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB