Codeginter $ this-> db-> where()函数在使用find_in_set()函数时自动在查询中查询"IS NULL"

Aab*_*sha 16 codeigniter find-in-set

我正在codeigniterFIND_IN_SET()函数编写查询.

   $this->db->where(FIND_IN_SET('".$value."',employer_job_location));
    $query_res= $this->db->get("employer_posted_jobs");
   echo $this->db->last_query(); exit;
Run Code Online (Sandbox Code Playgroud)

它正在屈服

SELECT * 
FROM (`employer_posted_jobs`) 
WHERE (FIND_IN_SET('Delhi',employer_job_location)) IS NULL
Run Code Online (Sandbox Code Playgroud)

在上面的查询"IS NULL"是额外的,它是非常烦人的.任何人都可以告诉为什么这与查询一起出现?谢谢..

Mic*_*l K 18

您必须始终以某种方式检查FIND_IN_SET()函数的结果以使其工作,请尝试以下操作:

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