--- db/prgsrc/db.cgi 2001/05/17 23:31:08 1.20 +++ db/prgsrc/db.cgi 2001/05/18 20:16:33 1.21 @@ -160,9 +160,18 @@ sub Search { } else { $sstr = join " OR $f LIKE ", @sar; } - - $sth = $dbh->prepare("SELECT QuestionId FROM Questions - WHERE $f LIKE $sstr ORDER BY QuestionId"); + +### Changed by R7 to prevent showing similar questions######### + + 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)