Changed SQL-requests + function to retrieve login variables