Jump to content

php array push like condition question


treehstn

Recommended Posts

Hi everyone,

 

I am NO coder so please bear with me!  This is a line in one of the files on my site. 

 

array_push($strings, "(e.patternName like '%".$_POST['p_keyword']."%' OR e.pattern1 like '%".$_POST['p_keyword']."%' OR e.pattern2 like '%".$_POST['p_keyword']."%' OR e.pattern3 like '%".$_POST['p_keyword']."%' OR e.pattern4 like '%".$_POST['p_keyword']."%')");

 

Let's say that the keyword used is 25.  The search results end up being 25, 2225, 5425, etc.  How can the code be written so that wildcards are ok but in the absence of any it's an absolute search?

Link to comment
https://forums.phpfreaks.com/topic/133567-php-array-push-like-condition-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.