how would i go about removing duplicates from an array without outputting it to a database and using SQL?