php - Get user id from wp_usermeta table -


i have stored term ids in wp_usermeta table. want user id term id match user meta key 'location' value. have tried below query doing nothing.

global $wpdb;     $term = get_queried_object();     $query = $wpdb->get_results("select user_id wp_usermeta meta_key='location' , meta_value %s",'%'.$term->term_id.'%'); 

enter image description here

try this, not passing value correctly

$query = $wpdb->get_results("select user_id wp_usermeta meta_key='location' , meta_value '%s,%".$term->term_id."%'"); 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -