treehstn Posted November 20, 2008 Share Posted November 20, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.