Thank you! Those are great websites that I hadn’t seen yet. Someone was able to help me out a little bit but I cleaned up my code some using your tips. This is my result.
<?php
add_shortcode('factioncount', 'FactionCount');
function FactionCount() {
global $wpdb;
//my table
$table = $wpdb->prefix . "bp_groups_groupmeta";
//query for my tags
$ald_tags = $wpdb->get_results("SELECT * FROM {$table} WHERE meta_key = 'gtags_group_tags' AND meta_value LIKE '%aldmeri-dominion%'");
$ald_tags = (array_filter($ald_tags));
print_r($ald_tags);
$ald_tags = count(array_keys($ald_tags));
return $ald_tags;
}
?>