Question

How can i use multiple meta_key and meta_value to search users?

For example, i want to search & find user name is "David" & location in "London".

I'm using this query, But nothings in result!

$query = "SELECT user_id FROM $wpdb->usermeta WHERE (meta_value LIKE '%%david%%') AND (meta_key = 'first_name') AND (meta_value LIKE '%%london%%') AND (meta_key = 'location')";

$rows = $wpdb->get_results($query);

Thanks

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top