- sql - Changed login query to use join instead of 2 queries, also fixed exception.