Searching custom fields

If I have a bunch of data in a custom field that is a textarea multiline, example:

12345
25939
1992
929
99283
2983
9383
94858
2082

just a bunch of data, is there a way that if I have someone with a number like that, where using PHP, I can search who has that in their textarea custom field?

like say the number was 929, so is there a way to see which member id, has 929 in that field and get their ID or user_login?

so that I can then programmically in PHP go pull those users out and display info about them?

You can have the user’s custom fields in PHP area with something like this:

$custfields = get_user_meta($user->ID, $wpdb->prefix.'s2member_custom_fields', true);

This is an array with all the custom fields, by ID of the field you will find “that one” as text and can search into.

But what if you don’t know the ID? you are just trying to find members that have that “929” in their custom field, so we can call those members or do whatever we need to do with them?

I mean, like find ALL members that have 929 in their custom field named “cards_joined”, something like that. Then in PHP I can loop through the list (best if returns array of ID’s that have that custom field value in their tag… and then I can do what I need to do with that search.

The problem I have is that the field “cards_joined” would be a Text Area with a bunch of values, like I showed in my first post here… and I need to find those that have within that list, the value I’m looking for… as one of the list items in the textarea

Understand now. Do a search in the $wpdb->usermeta table, with $wpdb->prefix.‘s2member_custom_fields’ as metakey and “meta_value like ‘%!929!%’”, but instead “!” use the “line break” char(s), that stay there.