Welcome Guest, Not a member yet? Register   Sign In
Getting user id
#1

Hi guys how can i get the id of the user on users table? I use this function but it mismatch the role_id with id on users table
   public function login($data){

        $this->db->from('users');
        $this->db->join('roles','roles.id = users.role_id');
        $this->db->where('users.username'$data['username']);
        
        $query = $this->db->get();
        if ($query->num_rows() == 0){
            return false;
        }
        else{
            $result = $query->row_array();
            $validPassword = password_verify($data['password'], $result['password']);
            if($validPassword){
                return $result = $query->row_array();
            }
        }
    }
Reply
#2

Go there

https://github.com/lonnieezell/myth-auth
Enlightenment  Is  Freedom
Reply
#3

(06-12-2021, 11:39 PM)paliz Wrote: Go there

https://github.com/lonnieezell/myth-auth


Thank you.
any idea how can i edit this query and get the user id also?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB