[eluser]srpurdy[/eluser]
This just depends on what you want to do with it, and how much options you want.
For example really basic example:
Code needed for controller method.
Code:
$this->load->model('search_model');
$data['do_search'] = $this->search_model->do_search($this->input->post('search'));
model method do_search
Code:
function do_search($terms)
{
$terms_array = explode(' ', $terms);
$this->db->like('text', $terms);
foreach($terms_array as $key)
{
$this->db->or_like('text', $key);
}
$this->db->select('text,name');
$this->db->from('pages');
$search = $this->db->get();
return $search;
}
View - just foreach the result from above.
Code:
<?php foreach($do_search->result() as $ds):?>
<?php endforeach;?>
Of course you might want to put some limitations like a min amount of characters at least. This is about as simple as it gets. You can pretty easily build on it though.
And also which fields in your db you actually want to search through.