How to query mysql `$ wpdb-> get_var`` bp_groups` in buddypress?
$ wpdb stores information only in Wordpress tables. Buddypress will be in a different place.
The next page has a database map with default table names. Since the "wp_" part is undefined, you will want to use $wpdb->prefix
http://api.buddypress.org/development/legacy-analysis/data-model-1-dot-3/
Therefore, any of the following should work fine.
$table = $wpdb->prefix."bp_groups"; $wpdb->get_var("SELECT COUNT(*) FROM $table;"); or inline
$wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}bp_groups;"); You can use this schematic map as a guide for more information, for example, how many users are in certain groups, etc.
Good luck :)