Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在codeigniter中查询,其中;小于1“;及;“不为空”;无结果_Codeigniter - Fatal编程技术网

在codeigniter中查询,其中;小于1“;及;“不为空”;无结果

在codeigniter中查询,其中;小于1“;及;“不为空”;无结果,codeigniter,Codeigniter,我有一个表“tbsiswa”,我想使用查询“Select*FROM tbsiswa,其中'id_kelas'db->select(“*”); $this->db->from(“tbsiswa”); $this->db->where(“id_kelas如果列为空,则使用: $this->db->where(“nis不为NULL”,NULL,FALSE);如果列为空时为NULL,则使用: $this->db->where(“nis不为NULL”,NULL,FALSE);您可以这样做: functio

我有一个表“tbsiswa”,我想使用查询“Select*FROM tbsiswa,其中'id_kelas'<1和'nis'!=” 我想显示id_kelas=0且nis不为空的数据。但我在使用codeigniter的表格中没有显示任何内容

基于上表,我想显示数据:

  • 曼塔
  • 西普特
这就是我迄今为止所尝试的:

函数cekSiswaNonKelas(){
$this->db->select(“*”);
$this->db->from(“tbsiswa”);

$this->db->where(“id_kelas如果列为空,则使用:


$this->db->where(“nis不为NULL”,NULL,FALSE);

如果列为空时为NULL,则使用:

$this->db->where(“nis不为NULL”,NULL,FALSE);

您可以这样做:

function cekSiswaNonKelas(){
        $this->db->select("*");
        $this->db->from("tbsiswa");
        $this->db->where("id_kelas",0);
        $this->db->where("nis!=","");
        $siswaNonKelas = $this->db->get();
        return $siswaNonKelas;
    }
您可以这样做:

function cekSiswaNonKelas(){
        $this->db->select("*");
        $this->db->from("tbsiswa");
        $this->db->where("id_kelas",0);
        $this->db->where("nis!=","");
        $siswaNonKelas = $this->db->get();
        return $siswaNonKelas;
    }