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

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

function search() {
        $terms = $this->input->post('searchterms');
        $this->db->select('idiom, slug');
        $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!


It would really help if you told us what was at line 18. Smile

Sorry! Absolutely stupid I am!! I had forgotton to define the field as a fulltext index in mysql. What a plonker!


Theme © iAndrew 2016 - Forum software by © MyBB