version 1.19, 2001/05/17 03:57:32
|
version 1.21, 2001/05/18 20:16:33
|
Line 110 sub Search {
|
Line 110 sub Search {
|
my ($dbh, $sstr, $metod) = @_; |
my ($dbh, $sstr, $metod) = @_; |
my (@arr, @Questions, @fields); |
my (@arr, @Questions, @fields); |
my (@sar, $i, $sth,$where); |
my (@sar, $i, $sth,$where); |
|
my $btime=time; |
|
|
# push @fields, 'Question'; |
# push @fields, 'Question'; |
|
|
Line 159 sub Search {
|
Line 160 sub Search {
|
} else { |
} else { |
$sstr = join " OR $f LIKE ", @sar; |
$sstr = join " OR $f LIKE ", @sar; |
} |
} |
|
|
$sth = $dbh->prepare("SELECT QuestionId FROM Questions |
### Changed by R7 to prevent showing similar questions######### |
WHERE $f LIKE $sstr ORDER BY QuestionId"); |
|
|
if (param('showequal') eq 'yes') { |
|
$sth = $dbh->prepare("SELECT QuestionId FROM Questions |
|
WHERE $f LIKE $sstr ORDER BY QuestionId"); |
|
} else { |
|
$sth = $dbh->prepare("SELECT QuestionId FROM Questions LEFT JOIN equalto |
|
ON equalto.First=QuestionId WHERE (First IS NULL) AND |
|
($f LIKE $sstr) ORDER BY QuestionId"); |
|
} |
|
|
|
|
} #else -- processing old-style query (R7) |
} #else -- processing old-style query (R7) |
|
|
Line 169 sub Search {
|
Line 179 sub Search {
|
while (@arr = $sth->fetchrow) { |
while (@arr = $sth->fetchrow) { |
push @Questions, $arr[0]; |
push @Questions, $arr[0]; |
} |
} |
|
print br, "Search time: ",time-$btime," sec",br if $debug; |
return @Questions; |
return @Questions; |
} |
} |
|
|