Jim R Posted January 14, 2012 Author Share Posted January 14, 2012 The output is just going to be a list of where subscribers reside, and that will only be available to my editors. Users don't have the opportunity to change their own capability beyond subscribing, and none of the subscription levels affects what they can see on the back end. Which is also to say I don't follow what your concern is. Quote Link to comment https://forums.phpfreaks.com/topic/254809-query-matching-multiple-columns-in-multiple-rows-serialized-data/page/3/#findComment-1307474 Share on other sites More sharing options...
Jim R Posted January 14, 2012 Author Share Posted January 14, 2012 SELECT * FROM wp_usermeta um1 INNER JOIN wp_usermeta um2 JOIN wp_users u ON um1.user_id=um2.user_id WHERE um1.meta_key = 'wp_s2member_custom_fields' AND um2.meta_value LIKE "%s2member_level%" AND um1.user_id = u.ID ORDER BY um1.user_id Is that the one? SELECT * FROM wp_usermeta um1 INNER JOIN wp_usermeta um2 JOIN wp_users u ON um1.user_id=um2.user_id WHERE um1.meta_key = 'wp_s2member_custom_fields' AND um2.meta_value LIKE "%s2member_level%" AND um1.user_id = u.ID GROUP BY um1.user_id ORDER BY um1.user_id, um1.umeta_id DESC //edit sorry group by before order by @Andy, That worked very well. Thank you. @PFMaBiSmAd I'm still curious about your security concern. Is it really an issue considering how the output will be? I'm sure I'll be back trying to get help on how to display it how I want. I have a bit of an idea, but I'll give it a shot. It will eventually look like this for each region: Region # (# of subscribers) Yearly: user, user, user, user, user, etc Semi-annual: user, user, user, user, user, etc Monthly: user, user, user, user, user, etc Quote Link to comment https://forums.phpfreaks.com/topic/254809-query-matching-multiple-columns-in-multiple-rows-serialized-data/page/3/#findComment-1307475 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.