No products in the cart.
- This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
- AuthorPosts
-
November 25, 2013 at 5:58 am #10039
user3030176ParticipantThis query works and returns the results that I want in MySQL but how do I get this to work in wordpress?
SELECT * FROM `wp_usermeta` WHERE `meta_key` = 'points' AND `user_id` = '1'I want to be able to see all the ‘points’ earned by user 1. I need to be able to display this on posts and pages in wordpress.
November 25, 2013 at 6:01 am #10042
narekParticipantglobal $wpdb; $result = $wpdb->get_results( "SELECT * FROM wp_usermeta WHERE meta_key = 'points' AND user_id = '1'"); print_r($result);Read this.
November 25, 2013 at 6:01 am #10041
jaydeep-nameraParticipantUse following code…..
$q="SELECT * FROM wp_usermeta WHERE meta_key = 'points' AND user_id = '1'"; $result = $wpdb->get_results($q);It will return array as result.
February 3, 2022 at 7:05 am #10040
amit-kumar-proParticipantYou should try following code :
global $wpdb; $result = $wpdb->get_results( "SELECT * FROM ".$wpdb->prefix."usermeta WHERE meta_key = 'points' AND user_id = '1'"); print_r($result);Hope it will helpful.
- AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.