Hi all, I'm using the following query to perform a search on the member database, specifically the custom s2member fields.
$users = $wpdb->get_results ("SELECT `user_id` as `ID` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "s2member_custom_fields' AND `meta_value` REGEXP '.*\"".$searchfield."\";s:[0-9]+:\"".$searchvar."\".*'");
How do I alter this so it looks for matches LIKE the $searchvar instead of exact matches? for example, in regular SQL it would be, ...where $searchfield LIKE '%$searchvar%' so "epix" would match "epix media" or "somethnig epix something" for example...
Thank you
Zoe