Altered get_user_details to work with new database