我想了解那些用户的元价值就像“代理”一样。但此查询不起作用

时间:2021-04-01 作者:Sam
SELECT display_name FROM $wpdb->users WHERE id IN (SELECT user_id from $wpdb->usermeta where meta_value LIKE \'%agent%\')
1 个回复
SO网友:Majid Ali

Try this

global $wpdb;
$sql = "SELECT display_name FROM ".$wpdb->prefix."users WHERE id IN (SELECT user_id from ".$wpdb->prefix."usermeta where meta_value LIKE \'%agent%\')";
$result = $wpdb->get_results($sql);