如何在codeigniter 3中检查用户男性或女性使用会话
**在codeigniter中,如何通过使用会话id比较$this->brid\u groom\u fetch->get\u program\u specific\u gender()函数中的数据来检查登录的用户是男性还是女性**如何在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
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用户有可能帮助您吗?