Buddypress Grands Dropdown
<div>
<?php global $bp,$wpdb;
$group_id = get_post_meta( $post->ID, 'campaign_group_id', true );
$group_results = $wpdb->get_results("SELECT id,name FROM {$wpdb->prefix}bp_groups ORDER BY ID ASC");
?>
<label for="meta-box-dropdown">ADD/EDIT</label>
<select name="meta-box-dropdown">
<?php foreach($group_results as $group_result): ?>
<option <?php echo ($group_id==$group_result->id)?"selected=selected":"" ?> value="<?php echo $group_result->id ?>"><?php echo $group_result->name ?></option>
<?php endforeach; ?>
</select>
<br>
</div>
thorak