Should fix error with DB != MSSQL || MySQL bug #517151

git-svn-id: file:///svn/phpbb/trunk@2146 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2002-02-14 17:43:56 +00:00
parent c95ae7fb21
commit 4421575ccb

View file

@ -115,12 +115,10 @@ function add_search_words($post_id, $post_text, $post_title = "")
$search_raw_words['title'] = split_words(clean_words("post", $post_title, $synonym_array)); $search_raw_words['title'] = split_words(clean_words("post", $post_title, $synonym_array));
$word = array(); $word = array();
$word_text_sql = array();
while( list($word_in, $search_matches) = @each($search_raw_words) ) while( list($word_in, $search_matches) = @each($search_raw_words) )
{ {
if( !empty($search_matches) ) if( !empty($search_matches) )
{ {
$word_text_sql[$word_in] = "";
for ($i = 0; $i < count($search_matches); $i++) for ($i = 0; $i < count($search_matches); $i++)
{ {
$search_matches[$i] = trim($search_matches[$i]); $search_matches[$i] = trim($search_matches[$i]);
@ -128,7 +126,6 @@ function add_search_words($post_id, $post_text, $post_title = "")
if( $search_matches[$i] != "" ) if( $search_matches[$i] != "" )
{ {
$word[] = $search_matches[$i]; $word[] = $search_matches[$i];
$word_text_sql[$word_in] .= ( ( $word_text_sql[$word_in] != "" ) ? ", " : "" ) . "'" . $search_matches[$i] . "'";
} }
} }
} }
@ -139,12 +136,14 @@ function add_search_words($post_id, $post_text, $post_title = "")
sort($word); sort($word);
$prev_word = ""; $prev_word = "";
$word_text_sql = "";
$temp_word = array(); $temp_word = array();
for($i = 0; $i < count($word); $i++) for($i = 0; $i < count($word); $i++)
{ {
if ( $word[$i] != $prev_word ) if ( $word[$i] != $prev_word )
{ {
$temp_word[] = $word[$i]; $temp_word[] = $word[$i];
$word_text_sql .= ( ( $word_text_sql != "" ) ? ", " : "" ) . "'" . $word[$i] . "'";
} }
$prev_word = $word[$i]; $prev_word = $word[$i];
} }