codeigniter-base-model icon indicating copy to clipboard operation
codeigniter-base-model copied to clipboard

How kind of fuzzy query? like?

Open abin2011 opened this issue 11 years ago • 1 comments
trafficstars

The $this->db->like('name','david') was not support? Or use $before_get function ? I wrote it myself?

abin2011 avatar May 08 '14 07:05 abin2011

Of course you can! :-)

class Post_model extends MY_Model
{
    public function search($column, $term, $w = 'both')
    {
        $this->db->like($column, $name, $w);
        return $this;
    }
}

Use it like this:

$this->post_model->search('title', 'Hello')
    ->get_all();

jamierumbelow avatar May 17 '14 12:05 jamierumbelow