Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/282.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 如何在codeigniter中创建多个注册_Php_Codeigniter_Model - Fatal编程技术网

Php 如何在codeigniter中创建多个注册

Php 如何在codeigniter中创建多个注册,php,codeigniter,model,Php,Codeigniter,Model,我的模型在这里…但我需要选择管理员的状态。。。。。。。但是 我是codeigniter的新手…不知道如何选择。。。我的需要是。。。 从“条件管理状态”表中选择“管理全部详细信息”= 活动且id=1 我的模型是: 公共函数登录($value){ $query=$this->db->get_where('tbl_admin',$value,1,'active'); 如果($query->num\u rows()>0){ $row=$query->row_数组(); $sess\u arr=阵列( “

我的模型在这里…但我需要选择管理员的状态。。。。。。。但是 我是codeigniter的新手…不知道如何选择。。。我的需要是。。。 从“条件管理状态”表中选择“管理全部详细信息”= 活动且id=1

我的模型是:

公共函数登录($value){

$query=$this->db->get_where('tbl_admin',$value,1,'active');
如果($query->num\u rows()>0){
$row=$query->row_数组();
$sess\u arr=阵列(
“管理员用户”=>$row[“管理员用户名”],
'adm_key'=>$row['fld_admin_key'],
“管理类型”=>$row[“fld\U管理类型”],
'admin_id'=>$row['fld_admin_id'],
“管理员已登录”=>TRUE
);
$this->session->set\u userdata($sess\u arr);
//echo”“;打印($this->session->all_userdata());退出;
$query = $this->db->get_where('tbl_admin', array('id' => 1, 'status' => 'active'));
} 否则{ $this->session->set_flashdata('error','Invalid username/password'); 重定向(“adminzone”); } }

第一行的正确语法为:

$query = $this->db->get_where('tbl_admin', array('id' => $value, 'status' => 'active'));
即,获取_的第二个参数,其中是字段及其值的关联数组

编辑:或许应该是这样

(我不确定$value变量在这里的作用)

$query = $this->db->get_where('tbl_admin', array('id' => $value, 'status' => 'active'));