Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/296.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
Php 代码点火器多个where子句不起作用_Php_Codeigniter - Fatal编程技术网

Php 代码点火器多个where子句不起作用

Php 代码点火器多个where子句不起作用,php,codeigniter,Php,Codeigniter,当页面加载性别=3时,如果单击女性按钮性别=1,如果单击男性按钮性别=2,则代码点火器模型返回json_encode结果。现在我想在if条件中添加另一个where语句。查看当性别=3时的条件 函数get_data_all($gender,$age_min,$age_max){ $counter=0; $this->db->select('*'); 如果($性别==1){ $this->db->where('gender','F');//正在工作 $counter++; } elseif(性别=

当页面加载性别=3时,如果单击女性按钮性别=1,如果单击男性按钮性别=2,则代码点火器模型返回json_encode结果。现在我想在if条件中添加另一个where语句。查看当性别=3时的条件

函数get_data_all($gender,$age_min,$age_max){ $counter=0; $this->db->select('*'); 如果($性别==1){ $this->db->where('gender','F');//正在工作 $counter++; } elseif(性别=2){ $this->db->where('gender','M');//正在工作 $counter++; } 埃尔塞伊夫(性别=3){ $names=数组('F','M'); $this->db->where_in('gender',$names);//正在工作 $this->db->where('age>=',12);//不工作
$this->db->where('age您需要替换以下行:

$this->db->where('age>=', 12);  //not working
$this->db->where('age<=', 18);  //not working  
$this->db->where('age>=',12);//不工作
$this->db->where('age=',12);
$this->db->where('age','=12',FASLE,FALSE);
$this->db->where('age=',12,FALSE);

$this->db->where('age您需要替换以下行:

$this->db->where('age>=', 12);  //not working
$this->db->where('age<=', 18);  //not working  
$this->db->where('age>=',12);//不工作
$this->db->where('age=',12);
$this->db->where('age','=12',FASLE,FALSE);
$this->db->where('age=',12,FALSE);

$this->db->where('age在列名和比较运算符中添加空格

$this->db->where('age >= ', 12);
$this->db->where('age <= ', 18);
$this->db->where('age>=',12);

$this->db->where('age在列名和比较运算符中添加空格

$this->db->where('age >= ', 12);
$this->db->where('age <= ', 18);
$this->db->where('age>=',12);

$this->db->where('age看一看,在
'age>='
处给空格试试,我不确定您的表名
sudent\u details
是否有打字错误,在
'age>='
处给空格试试,我不确定您的表名
sudent\u details
$this->db->where('age >= ', 12);
$this->db->where('age <= ', 18);