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 3中检查用户男性或女性使用会话_Codeigniter - Fatal编程技术网

如何在codeigniter 3中检查用户男性或女性使用会话

如何在codeigniter 3中检查用户男性或女性使用会话,codeigniter,Codeigniter,**在codeigniter中,如何通过使用会话id比较$this->brid\u groom\u fetch->get\u program\u specific\u gender()函数中的数据来检查登录的用户是男性还是女性** public function login_autho() { $data = array( 'uname' => $this->input->post('uname'), 'upas

**在codeigniter中,如何通过使用会话id比较$this->brid\u groom\u fetch->get\u program\u specific\u gender()函数中的数据来检查登录的用户是男性还是女性**

public function login_autho() {

        $data = array(
            'uname' => $this->input->post('uname'),
            'upassword' => $this->input->post('upassword')
        );
        $result = $this->login_model->login_user($data);

        print_r($result);
            $data_session_set = array('logged' => TRUE,
            'uname' => $this->input->post('uname'));
        $this->session->set_userdata($data_session_set);
    }
    public function profile() {
        $this->load->view('header');
         $this->load->model('brid_groom_fetch');

         //here how to check gender
         $gender_result=$this->brid_groom_fetch->get_program_specific_gender();

    }
在profile controller中,我只想检查登录用户是男性还是女性

     if ($this->session->all_userdata('uname') == "gender") {

          echo 'success';

            }
 else {

            echo 'Fail';
 }

您是否编写了函数
get\u program\u specific\u gender
?是否有用于标识性别的数据库字段?通过此函数从数据库中获取数据,我想比较用户名是否为男性,然后显示所有女性在此我想了解用户性别,而不知道
get\u program\u specific\u gender
函数代码和表结构,您认为stackoverflow用户有可能帮助您吗?