i transferred the code and it works.
the only minor niggle is that when i did it the clumsy way around, by adding a list of filter criteria, instad of one at a time and repeating the loop, i could eliminate duplicates by using SELECT DISTINCT.
printing the rows one at a time won't let me do this.
i think what i'll do is pass the query results into a new array, run the array unique() function, and print that out.
do you think that would be the best approach ?