Notifications
Clear all

Paid Addons Support Forum Only

Please note, that here we only support Paid Addons issues and questions.

gVectors Support staff works from 6am to 6pm (GMT+0)

All questions related to wpForo and wpDiscuz free plugins should be asked in the corresponding plugin support forum:

 

wpDiscuz Support Forum   wpForo Support Forum

Query wp_wpforo_profiles.fields with MYSQL  


Tim Rodman
Posts: 27
Customer
(@tim40)
Member
Joined: 3 years ago

Do you have any tips on how to extract information out of wp_wpforo_profiles.fields with MYSQL?

Let's say I want to extract the values for a particular custom field. Or maybe I want to find all records where a custom field value equals a particular value.

I really like wpForo, but I don't like how custom fields are stored. I wish they were stored in the wp_usermeta table.

 

4 Replies
Astghik
Posts: 4382
Admin
(@astghik)
Support Team
Joined: 3 years ago

Hi @tim40,

there is no special SQL that allows you to get the value of the field. You'll need to get the date form wp_wpforo_profiles table's "fields" column, then decode the JSON and use the values of the specific keys.

Reply
Tim Rodman
Posts: 27
Customer
(@tim40)
Member
Joined: 3 years ago

Do you have any PHP code that you can share showing how to do this?

Reply
1 Reply
Astghik
Admin
(@astghik)
Joined: 3 years ago

Support Team
Posts: 4382

@tim40,

No necessary to use custom codes, you can use wpforo_member(1, 'field_key'); function:

1 - the first value is the User ID,

2 - field_key can be found as shown in the screenshot

field key
Reply
Tim Rodman
Posts: 27
Customer
(@tim40)
Member
Joined: 3 years ago

Actually, that's not too bad. I like it! I can loop through the SQL results and add the data to a table. Thanks!

Reply
Share:
Scroll to top
0

Your Cart