I am filtering some data, I have a field called "faculty" and the options are "Professor, Associate Professor, Research Professor" ... so on. My filtering works for every other field but for this specific case I am having trouble because the professor word appears in all the data and as a result, I get all the data that matches the word "professor" so it is not filtering anything. How can I make it to search only for the specific word 'Professor' and avoid getting all the others (research professor, associate professor...)?
// My code
function get_search_filters($limit, $start, $search_faculty)
{
$this->db->order_by('lname', 'asc'); //order records by last name
$this->db->limit($limit, $start);
/* search keyword in all columns*/
$this->db->like('faculty', $search_faculty);
$query = $this->db->get('expertise');
if ($query->num_rows() > 0) {
foreach ($query->result() as $row) {
$data[] = $row;
}
return $data;
}
return false;
}