Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-04T03:27:31-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=16117 2011-12-04T03:27:31-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16117&p=54514#p54514 <![CDATA[Re: LIKE query]]>

Statistics: Posted by Cristián Lávaque — December 4th, 2011, 3:27 am


]]>
2011-12-02T04:19:35-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16117&p=54383#p54383 <![CDATA[Re: LIKE query]]> Statistics: Posted by epixmedia — December 2nd, 2011, 4:19 am


]]>
2011-12-02T04:11:57-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16117&p=54382#p54382 <![CDATA[Re: LIKE query]]>
In the meantime I will continue to Google!

Thanks,

Zoe

Statistics: Posted by epixmedia — December 2nd, 2011, 4:11 am


]]>
2011-12-02T04:04:31-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16117&p=54380#p54380 <![CDATA[Re: LIKE query]]> Statistics: Posted by epixmedia — December 2nd, 2011, 4:04 am


]]>
2011-12-02T03:11:20-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16117&p=54374#p54374 <![CDATA[Re: LIKE query]]>
http://dev.mysql.com/doc/refman/5.0/en/regexp.html
http://dev.mysql.com/doc/refman/5.0/en/ ... ching.html

I haven't used regex in queries yet, so I had to look them up, I'm familiar with PHP ones.

I haven't tested this, but you could try .* before and after the $searchvar:

'.*\"" . $searchfield . "\";s:[0-9]+:\".*" . $searchvar . ".*\".*'

I hope it helps. :)

Statistics: Posted by Cristián Lávaque — December 2nd, 2011, 3:11 am


]]>
2011-12-01T03:15:31-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16117&p=54302#p54302 <![CDATA[Re: LIKE query]]>
Cheers,

Zoe

Statistics: Posted by epixmedia — December 1st, 2011, 3:15 am


]]>
2011-11-29T08:17:59-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16117&p=54193#p54193 <![CDATA[LIKE query]]>

$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

Statistics: Posted by epixmedia — November 29th, 2011, 8:17 am


]]>