I have to grab groups title from the database and store them into an assortment, but I'd rather not grab exactly the same category two times. It is possible to method to, after i grab the course title and store it into an assortment to skip that category and never store it anymore?

SELECT DISTINCT categoryname FROM CategoryTable

If DISTINCT does not meet your needs (perhaps you have multiple queries...), you need to use your array like a set. Make use of this to increase the array:

arr[$category] = true;

In MySQL, basically understand your question:

  select distinct `category` from table;