[eluser]theprodigy[/eluser]
[quote author="Kraig" date="1345860880"]I try the following the code and I get no results when there should be. The commented query works.
Code:
$key = trim($key);
$keys = explode(" ", $key);
$this->db->select('*');
$this->db->from('upload');
foreach($keys as $piece){
$this->db->or_like('name', $piece);
}
$this->db->limit($start, $limit);
$query = $this->db->get();
//$query = $this->db->query("SELECT * FROM upload WHERE name LIKE '%".$key."%' LIMIT $start, $limit");
[/quote]
The only things I would do to this is:
1. No need for the select('*'). If you don't set the select, CI does this automatically.
2. Where are you setting your $start and $limit variables?