php - MySQL search multiple words in loop -


$keywords=array("test","tset"); $matches = implode(',', $keywords); $sql = "select * `reg` title in '%$matches%' group p_title";  $data = mysql_query($sql);  while($info=mysql_fetch_array($data)) { print " {$info['title']}<br /> "; } 

i want write query

   $sql = "select * `reg` title in '%test%' group p_title";    $sql = "select * `reg` title in '%tset%' group p_title"; 

........

how can search each keyword in 1 query ?

"select * reg title in '%test%' or  title in '%tset%' group p_title" 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -