[英]Buddypress Xprofile Custom Fields Type (Loop user profile field)
I'm trying to create a site where the members can search for each other based on various profile fields like "games", "platform", "skill level" etc. 我正在尝试创建一个站点,成员可以在该站点上根据各种个人资料字段(例如“游戏”,“平台”,“技能水平”等)相互搜索。
I want to be able to fetch datas on how many people have different tags on them. 我希望能够获取有关有多少人在其上具有不同标签的数据。
Under the skill level for example i have "beginner", "intermediate" and "hardcore" I wanna grab the number from each so i can pull them out like Beginner: 30 people, intermediate: 199 people etc. 例如,在技能水平下,我有“初学者”,“中级”和“硬核”,我想从每个人那里获取数字,这样我就可以像初学者:30人,中级:199人,等等。
Is this possible? 这可能吗? And how?
如何?
global $wpdb;
$results = $wpdb->query( "SELECT count( `user_id`) FROM `sf_bp_xprofile_data` WHERE `field_id`= 8 AND `value` = 'woman'" );
change field id and value according for you 根据您的需要更改字段ID和值
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.