获取与给定输入匹配的名称

am using code as below.according to the review name the details are getting. what i require is if i give a particular word that is for example "san" for searching the names matching to that has to be displayed.that is sangee, santhosh,..... for you to understand example is facebook in which if we go to search and add some name it will be showing the names matching to that in the similar way we require the output for our app. the input should be dynamic. thanks

$this->db->select('reviewee_name');
$this->db->from('reviews');
$this->db->where('reviewee_name', $input['reviewee_name']);
$query = $this->db->get();

Simply change

$this->db->where('reviewee_name', $input['reviewee_name']);

Into

$this->db->like('reviewee_name', $input['reviewee_name']);

Don't do this

$this->db->like('reviewee_name', '%'. $input['reviewee_name'] .'%');

It creates another % inside %, like this

WHERE reviewee_name LIKE '%%reviewee_name%%'

For more information visit http://ellislab.com/codeigniter/user-guide/database/active_record.html

You will probably get better results using something similar to

$this->db->select('reviewee_name');
$this->db->from('reviews');
$this->db->like('reviewee_name', $input['reviewee_name']);
$query = $this->db->get();

Although this is untested.

You can read more about LIKE here

http://www.w3schools.com/sql/sql_like.asp