I have this code:
global $wpdb;
$query = "SELECT DISTINCT meta_value
FROM $wpdb->postmeta
WHERE meta_key = 'product_brand'
ORDER BY meta_value;";
$directors = $wpdb->get_results( $query );
foreach( $directors as $director ) :
echo $director->meta_value . ', ';
endforeach;
This code will show all meta values having the meta_key "product_brand".
On category pages, what I want to do is list all unique meta values having the meta_key "product_brand" from the current category.