Updated getUser() method to use SQL where clause to increase efficiency