Added new method for preparing field names for the database query. Used in inserts and orderbys