此代码:
$this->db->where('id_etablissement_commanditaire IS ', $_POST['id_etablissement_commanditaire'], FALSE );
给出:
WHERE id_etablissement_commanditaire IS NULL
那一个:
$this->db->where('id_etablissement_commanditaire IS ', $_POST['id_etablissement_commanditaire']);
给出:
WHERE `id_etablissement_commanditaire` IS 'NULL'
有没有办法获得:
WHERE `id_etablissement_commanditaire` IS NULL
即。我想要反叛但不是引用。
答案 0 :(得分:0)
尝试这样的事情:
if ($_POST['id_etablissement_commanditaire']) {
$this->db->where('id_etablissement_commanditaire IS ', $_POST['id_etablissement_commanditaire']);
} else {
$this->db->where('id_etablissement_commanditaire IS NULL', null, false)
}