Welcome Guest, Not a member yet? Register   Sign In
Annoying call to member function on non-object problem
#1

[eluser]september28[/eluser]
Sorry if this is really obvious but i have been tearing my hair out trying to figue out what i am doing wrong here...
This is the function in my IdiomSearch_model class

Code:
function search() {
        $terms = $this->input->post('searchterms');
        $this->db->select('idiom, slug');
        $this->db->from('idioms');
        $this->db->where('MATCH (idiom) AGAINST ("'.$terms.'")', NULL, FALSE);
        $query = $this->db->get();
        $result = $query->result();
        if($result) {
            return $result;
        }
        return FALSE;
    }

Basically I call this from a controller and then just load the result into an the $data['searchresults'] to send to the template. When i submit the search form all i get is an error: Fatal error: Call to a member function result() on a non-object in /var/www/idm/system/application/models/idiomsearch_model.php on line 18

Its driving me crazy please help!

Thanks,
Dan


Messages In This Thread
Annoying call to member function on non-object problem - by El Forum - 04-29-2009, 06:21 AM
Annoying call to member function on non-object problem - by El Forum - 04-29-2009, 06:30 AM
Annoying call to member function on non-object problem - by El Forum - 04-29-2009, 06:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB