Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

SQL query for Buddypress Group Extension API Fields WordPress



I have a buddypress install with additional fields added using the Group Extension API, I would like you to write an sql query that returns a list of the groups, along with the values in specified fields

Groups to be listed horizontally, with the specified fields alongside in columns

Group Field1 Field2 Field3
Gr1 Ll1value Fl2value Fl3value
Gr2 Ll1value1 Fl2value2 Fl3value2

Answers (2)


Hariprasad Vijayan answers:


Please provide me the database via my email.. [email protected]

npeplow comments:


Hariprasad Vijayan comments:

Do you want the result in the same structure displayed in the site that you provided in mail?

Hariprasad Vijayan comments:

Can you please show me the current query that you are using.

npeplow comments:


I'm not using a query at the moment, please can you take a look at the wp_bp_groups_groupmeta and wp_bp_groups table.

I would like the group name to be in the first column (from wp_bp_groups), with this joined with meta keys (from wp_bp_groups_groupmeta, use bpgf_overview bpgf_jobroles bpgf_keyskills as column headers as an example)

Group bpgf_overview bpgf_jobroles bpgf_keyskills
Investment Banking sdfsdf tryurtyurt fgthjyututryu
Engineering kkhjkghjk gfhjgfhj wghjghehrwer

Hariprasad Vijayan comments:


Check this query,

SELECT name,(select meta_value from wp_bp_groups_groupmeta where wp_bp_groups_groupmeta.meta_key="bpgf_overview" and as Field1,(select meta_value from wp_bp_groups_groupmeta where wp_bp_groups_groupmeta.meta_key="bpgf_jobroles" and as Field2,(select meta_value from wp_bp_groups_groupmeta where wp_bp_groups_groupmeta.meta_key="bpgf_keyskills" and as Field3 FROM `wp_bp_groups` LIMIT 0 , 30

Good Luck...

npeplow comments:

Hariprasad, thats perfect - thanks!

Hariprasad Vijayan comments:

Happy to help... good luck..


Arnav Joy answers:

which plugin you are using?

npeplow comments:

Hi Arnav

I'm using my own custom plugin based off the group extension API, data is stored in the buddypress meta. Can provide you with database access if needed