• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with login use oracle xe and codeigniter 1.7.2

#1
[eluser]Unknown[/eluser]
guys, i have a problem with login. i think its cause the numrow function or limit offset. any body can solved it
im try in phpmyadmin this code can run, but in oracle cant

controler
Code:
function process_login()
    {
        $data['title'] = 'Login';
        $data['h2_title'] = 'SIMDAK Login >> Masukan username dan password';
        $data['content_id'] = 'login/login_view';
            
        $this->form_validation->set_rules('username', 'Username', 'required');
        $this->form_validation->set_rules('password', 'Password', 'required');
        
        if ($this->form_validation->run() == TRUE)
        {
            $username = $this->input->post('username');
            $password = $this->input->post('password');
            
                        
            if ($this->Login_model->check_user($username, $password) == TRUE)
            {
                $user = $this->user_model->get_id_by_username($username);
                //$data = array('user_id' => $user->user_id, 'fullname' => $user->fullname, 'pos_id' => $user->pos_id,'login' => TRUE);
                $data = array('USERNAME' => $username, 'fullname' => $user->fullname, 'pos_id' => $user->pos_id,'login' => TRUE);
                $this->session->set_userdata($data);
                redirect('home');
            }
else
            {
                $this->session->set_flashdata('message', 'Maaf, username dan atau password Anda salah');
                redirect('login/index');
            }
        }
        else
        {
            $this->load->view('login', $data);
        }
    }


model
Code:
function check_user($username, $password)
    {
        $query = $this->db->get_where($this->table, array('USERNAME' => $username, 'PASSWORD' => $password, 'IS_DELETED' => 0), 1, 0);
        
        if ($query->num_rows() > 0)

        {
            return TRUE;
        }
        else
        {
            return FALSE;
        }
    }


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.