I need to retrieve an array with category names.
It seems that tag names and category names are both stored in the same table (wp_terms), and to distinguish them you need to look in the wp_term_taxonomy table where the IDs from wp_terms are listed with options post_tag or category.
So I need to do some sort of relation query which, to be honest, is more than I can handle at this point. I did find that apparently there is some sort of a short cut to this. I haven’t been able to find a good description of the function, but if you consider this: $wpdb->categories->cat_name` you may know what it’s all about. I certainly don’t.
How do I get an array with the names of all defined categories including nothing else?
You can use
get_categoriesfor this.http://codex.wordpress.org/Function_Reference/get_categories
This will fetch all categories