Getting user id |
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(); } } }
(06-12-2021, 11:39 PM)paliz Wrote: Go there |
Welcome Guest, Not a member yet? Register Sign In |