def get_fields(db, fields_sql):
    """
    Calls the database and gets fields information.
    Input: database connection object, SQL query
    Returns: dictionary of student information, key=field name
    """
    fields = {}

    with db.cursor() as cursor:
        cursor.execute(fields_sql)
        for id, name, full_name in cursor.fetchall():
            fields[full_name] = id

    return fields