get_fields function

Get fields from table