If this is the case simply get your rows with a db_list_of_lists and then loop over them with a foreach.