Help with search query in Codeigniter

Posted by Indigo on Stack Overflow See other posts from Stack Overflow or by Indigo
Published on 2010-03-18T23:54:05Z Indexed on 2010/03/19 3:21 UTC
Read the original article Hit count: 174

Filed under:

Hi All,

Im still fairly new to codeigniter and am wondering if someone can help me with this please?

Im just trying to do a very basic search query in Codeigniter, but for some reason, the results are ignoring my "status = published" request...

The code is:

$this->db->like('title', $term);
$this->db->or_like('tags', $term);
$data['results'] = $this->db->get_where('resources', array('status' => 'published'));

And this dosent work either:

$this->db->like('title', $term);
$this->db->or_like('tags', $term);
$this->db->where('status', 'published');
$data['results'] = $this->db->get('resources');

Im sure its something basic? Help please?

© Stack Overflow or respective owner

Related posts about codeigniter