function FIND_IN_SET() not working in codeigniter function FIND_IN_SET() not working in codeigniter codeigniter codeigniter

function FIND_IN_SET() not working in codeigniter


You must always check the results from the FIND_IN_SET() function somehow to make it work, try this:

  $this->db->where("FIND_IN_SET('$value',employer_job_location) !=", 0);


function company_by_category_model($category_id){    $this->db->select('*');    $this->db->from('company_information,user_information');    $search="FIND_IN_SET ('".$category_id."',company_category)         AND company_information.allowstatus=1         AND company_information.delstatus=0         AND company_information.user_id=user_information.user_id";    $this->db->where($search);    $this->db->order_by('company_id','desc');    $query=$this->db->get();    return $query->result();}

Try removing single quote from $category_id this is variable


FIND_IN_SET() - this function is useful where you have comma separated list of values stored in database and want to check if a value exist in that comma separated list.

Example: WHERE FIND_IN_SET( ‘yellow’, color list )