Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

starapple on "Accessing and Manipulating Custom User meta Data"

$
0
0

I'd greatly appreciate help in learning about the appropriate way to store some custom user meta data. Users are required to enter their information in four columns in the following pipe separated format:

Wt|Rt|Group|Title
1|10|2|Name
2|15|2|Name 1
3|20|2|Name 2
4|25|2|Name
5|30|2|Name 1
1|11|3|Name
2|16|3|Name 1
3|21|3|Name 2
4|26|3|Name
5|31|3|Name 1

I need to be able to retrieve specific lines of information to do calculations. For example, if someone chooses Group 3 with a specific Group and Wt, I should be able to fetch the relevant Rt.

When I examine stored meta data in WP, some of it seems unreadable and I understand that's because it's serialized. However my data is stored literally as it is entered line by line by the user. Is there any benefit in serialization vs literal insertion of the meta data? (When I use the serialize() function it just chunks the entire batch of data.)

Could you please give an example of retrieving data in my example for someone choosing Group 3 with a Wt of 2 and fetching the Rt for use in a calculation?

I'm looking for the steps after get_user_meta( $user->ID, 'my_custom_groups');

Thanks.


Viewing all articles
Browse latest Browse all 8245

Trending Articles