simple query, I thought… get users from wp_usermeta
-
trying to solve a simple problem, I think.
in table wp_ / wp_usermeta
I have the following fields and info.
Assume I am on a page, user is logged in, I wish to show this user who else has marked a post for “watching”. I use wp-favourites plugin to allow user to watch a post (or item, in my case).
info:
umeta_id 27711
user_id 2
meta_key wpfp_favorites
meta_value a:3:{i:0;s:6:”342081″;i:1;s:6:”342073″;i:2;s:6:”342067″;}
the number ‘342073’ is a $post_ID, for example.how do I get get every user_id where meta_value contains $post_ID as array.
then resolve array into user_ID as nice name,wish to return list of users as comma seperated text.
such as “jeff, john, and Bill” are watching this post.
- The topic ‘simple query, I thought… get users from wp_usermeta’ is closed to new replies.