0

我的项目有错误,你能帮帮我吗?这是我的代码:

$q_cek_login = $this->db->get_where('tbl_karyawan', array('username' => $u, 'password' => $p));
    if(count($q_cek_login->result())>0)
    {
        foreach($q_cek_login->result() as $qck)
        {

            if($qck->id_jabatan==1)
            {
                foreach($q_cek_login->result() as $qad)
                {
                    $sess_data['logged_in'] = 'yesGetMeLogin';
                    $sess_data['username'] = $qad->username;
                    $sess_data['nama_pengguna'] = $qad->nama;
                    $sess_data['id_jabatan'] = $qad->id_jabatan;
                    $this->session->set_userdata($sess_data);
                }
                //header('location:'.base_url().'pemesanan/pending');
            }
        }
    }

然后我得到这个错误:

遇到 PHP 错误

严重性:通知

消息:未定义的属性:stdClass::$id_jabatan

文件名:models/model_digor.php

行号:26

谢谢你们…………

4

1 回答 1

0

请检查您的依赖类是否正确加载。比如 $this->load->library('database'); 或 $this->load->library('your_built_in_class');

于 2013-11-04T06:39:16.103 回答