SQL query: Get users by custom category value
-
Hello,
I am trying to retrieve a list of members with a SQL query based on a particular custom category. Since the custom field values are stored as an array in wp_s2member_custom_fields, this proves to be challenging. How do I join this field (let’s call it corporate_category) to a typical sql query of users?
It’s easy enough to search for the value I seek anywhere within the custom_fields in the DB, but what I am running into is that that user’s value for the category may also exist in other custom category information, so I need a stricter search. For example,a query that pulls “Doctor” categorized users in this manner would also pull any user with, say, a custom description that said they carried scrubs for doctors.
Pardon me if this is a duplicate topic; I could not find anything exactly on point. Thank you for your help!
- The topic ‘SQL query: Get users by custom category value’ is closed to new replies.