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
Post a Comment