Function to get the classes of a user from the database.
The ID of the user whose classes are to be fetched
Function to get the classes of a user from the database.