Re: Help with custom Group extension SQL
MIght sound like a no-brainer, but have you declared the globals?
`global $wpdb, $bp;`
You also have FROM twice in your query.
Also, I don’t see why you’d need the inner join. All you need to do is this:
`$result = $wpdb->get_results( $wpdb->prepare( “SELECT group_id, meta_value FROM {$bp->groups->table_name_groupmeta} WHERE meta_value = ‘United States’ AND meta_key = ‘state’ GROUP BY meta_value” ) );`
Haven’t actually tried the above query, but should be alright.