Is it possible to have several keywords in the search separated with an OR but only to show the records where there are ...let's say 4 of the 10 keywords available?
Do you mean like: $query = mysql_query("SELECT * FROM table WHERE field1='$one' OR field2='$two' OR field3='$three'"); That would work.
Like this: $sql="SELECT * FROM bible WHERE 1=1 AND"; $j=0; //to sort out all words with length less than 4 like AND, OR, BUT... for ($i=0; $i < count($searchTheseArr); $i++){ if(strlen($searchTheseArr[$i]) > 4){ $newSearchTheseArr[$j] = $searchTheseArr[$i]; //j renumbers the words of length 4 and up $j++; } } //sql searches only length 4 and up for ($j=0; $j < count($newSearchTheseArr); $j++){ $sql.=" text_data LIKE '%" .$newSearchTheseArr[$j]. "%'"; if($j!=count($newSearchTheseArr)-1){ $sql.=" OR"; }else{ //removes the OR from the last line and replaces with the following $sql.= " LIMIT " . $start . ", " . $perpage; } } PHP: It's only one field but several keywords in this case called: $newSearchTheseArr[$j]