[eluser]l1v1[/eluser]
You have to explode your $key variable with ' ' and run the query "x" times, like you said. I don't think if there is another way to do that.
I didn't test this code, so I don't know if it works, but try something like this:
Code:
public function search($key){
$query_array = array();
$keys = explode(' ',$key);
for($i=0;$i<count($keys);$i++{
$this->db->like('name',$keys[$i]);
$query = $this->db->from('upload');
if($query->num_rows()>0){
array_push($query_array,$query->result_array());
}
else{
return FALSE;
}
}
}