Custom Query
-
I am not a programmer and I am probably missing something really obvious. I have custom tags installed and setup for my groups. I want to run a query that displays the total count of how many groups has a certain tag.
I have been trying something like this. Any ideas?
function TagCount() { global $wpdb, $bp; $var_count = $wpdb->get_var("SELECT count( * ) FROM $bp->groups_groupmeta WHERE meta_key = 'gtags_group_tags' AND meta_value = '%MyTag%';"); echo 'count is ' . $var_count . ''; } add_shortcode('tagcount', 'TagCount'); ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom Query’ is closed to new replies.